[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFADYBIYqQjMx118@mango>
Date: Mon, 16 Jun 2025 11:43:34 +0000
From: Oliver Mangold <oliver.mangold@...me>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Asahi Lina <lina@...hilina.net>, rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 1/5] rust: types: Add Ownable/Owned types
On 250502 1157, Andreas Hindborg wrote:
> > +
> > +impl<T: Ownable> Owned<T> {
> > + /// Creates a new instance of [`Owned`].
> > + ///
> > + /// It takes over ownership of the underlying object.
> > + ///
> > + /// # Safety
> > + ///
> > + /// Callers must ensure that the underlying object is acquired and can be considered owned by
> > + /// Rust.
>
>
> This part "the underlying object is acquired" is unclear to me. How about:
>
> Callers must ensure that *ownership of* the underlying object has been
> acquired. That is, the object can be considered owned by the caller.
>
>
Yes, made me think about the phrasing, too. But the main point is, that the
object must be considered to be owned by the `Owned<T>` after the function
call, no?
So maybe:
Callers must ensure that ownership of the underlying object can be
transfered to the `Owned<T>` and must consider it to be transfered
after the function call. This usually implies that the object
most not be accessed through `ptr` anymore.
Powered by blists - more mailing lists