[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=B=AwWFJorzi7m83Y520uLzk+k5Hcu_dLHEuRvO7BY8Q@mail.gmail.com>
Date: Thu, 29 May 2025 13:59:30 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Tamir Duberstein <tamird@...il.com>
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>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rust: retain pointer mut-ness in `container_of!`
On Wed, Apr 9, 2025 at 4:43 PM Tamir Duberstein <tamird@...il.com> wrote:
>
> Avoid casting the input pointer to `*const _`, allowing the output
> pointer to be `*mut` if the input is `*mut`. This allows a number of
> `*const` to `*mut` conversions to be removed at the cost of slightly
> worse ergonomics when the macro is used with a reference rather than a
> pointer; the only example of this was in the macro's own doctest.
>
> Reviewed-by: Benno Lossin <benno.lossin@...ton.me>
> Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
> Signed-off-by: Tamir Duberstein <tamird@...il.com>
Applied to rust-next -- thanks everyone!
Cheers,
Miguel
Powered by blists - more mailing lists