[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLgj8g1d47u0eFD83topKg2d7FEG+cHS5+Be6+TLt06NmHg@mail.gmail.com>
Date: Fri, 23 Feb 2024 11:49:15 +0100
From: Alice Ryhl <aliceryhl@...gle.com>
To: Boqun Feng <boqun.feng@...il.com>
Cc: mathys35.gasnier@...il.com, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] rust: locks: Add `get_mut` method to `Lock`
On Fri, Feb 23, 2024 at 3:52 AM Boqun Feng <boqun.feng@...il.com> wrote:
> BTW, while we are at it, I think we should document the
> "structural/non-structural pinning" design decisions somewhere, for
> example in the struct definition:
>
> #[pin_data]
> pub struct Lock<T: ?Sized, B: Backend> {
> ...
> /// The data protected by the lock.
> /// This field is non-structural pinned.
> pub(crate) data: UnsafeCell<T>,
> }
>
> Thoughts? Or do we think "non-structural pinned" should be the default
> case so no need to document it? I want to have a clear document for each
> field to avoid the accidental "everyone forgets what's the decision
> here" ;-)
I would normally assume that "field is not marked #[pin]" implies that
it's not structurally pinned. But it could still be worth to call out
here.
I prefer the wording "not structurally pinnned" over "non-structural pinned".
Alice
Powered by blists - more mailing lists