From: Danilo Krummrich <dakr@kernel.org>
To: Andreas Hindborg <a.hindborg@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Lyude Paul" <lyude@redhat.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 10/14] rust: alloc: add `Box::into_pin`
Date: Mon, 9 Dec 2024 11:25:35 +0100 [thread overview]
Message-ID: <Z1bFn1uvu5M-2H9l@pollux.localdomain> (raw)
In-Reply-To: <87ser0ec7l.fsf@kernel.org>
On Fri, Dec 06, 2024 at 10:25:02PM +0100, Andreas Hindborg wrote:
> "Danilo Krummrich" <dakr@kernel.org> writes:
>
> > On Fri, Dec 06, 2024 at 08:33:02PM +0100, Andreas Hindborg wrote:
> >> Add an associated function to convert a `Box<T>` into a `Pin<Box<T>>`.
> >
> > What do you need this function for?
> >
> > There is an `impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>` already.
> >
>
> I didn't realize, but that could work as well. I was rebasing this
> series from before we did our own `Box`, and rust `Box` has this method,
> which I was using.
>
> At any rate, I think it would make sense to have `into_pin` as well as
> the `From` impl, to match the standard library. We could always
> implement one in terms of the other.
I'm not against that -- one of my earlier allocator series actually even had
this function. However, the feedback was to rather not have it at the time.
As mentioned, I'm still fine with including this function though.
Please implement `ìnto_pin` using the existing `From` trait for the next
iteration.
- Danilo
>
>
> Best regards,
> Andreas Hindborg
>
>
next prev parent reply other threads:[~2024-12-09 10:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 19:32 [PATCH v4 00/14] hrtimer Rust API Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 01/14] rust: time: Add Ktime::from_ns() Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 02/14] rust: hrtimer: introduce hrtimer support Andreas Hindborg
2024-12-07 14:35 ` Guangbo Cui
2024-12-07 17:36 ` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 03/14] rust: sync: add `Arc::as_ptr` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 04/14] rust: hrtimer: implement `TimerPointer` for `Arc` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 05/14] rust: hrtimer: allow timer restart from timer handler Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 06/14] rust: hrtimer: add `UnsafeTimerPointer` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 07/14] rust: hrtimer: implement `UnsafeTimerPointer` for `Pin<&T>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 08/14] rust: hrtimer: implement `UnsafeTimerPointer` for `Pin<&mut T>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 09/14] rust: hrtimer: add `hrtimer::ScopedTimerPointer` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 10/14] rust: alloc: add `Box::into_pin` Andreas Hindborg
2024-12-06 20:17 ` Danilo Krummrich
2024-12-06 21:25 ` Andreas Hindborg
2024-12-09 10:25 ` Danilo Krummrich [this message]
2024-12-06 19:33 ` [PATCH v4 11/14] rust: hrtimer: implement `TimerPointer` for `Pin<Box<T>>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 12/14] rust: hrtimer: add `TimerMode` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 13/14] rust: hrtimer: add clocksource selection through `ClockSource` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 14/14] rust: hrtimer: add maintainer entry Andreas Hindborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1bFn1uvu5M-2H9l@pollux.localdomain \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=anna-maria@linutronix.de \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox