Re: [PATCH 5/5] rust: pin-init: replace `addr_of_mut!` with `&raw mut`
From: Gary Guo
Date: Thu Mar 19 2026 - 07:12:41 EST
On Thu Mar 19, 2026 at 9:35 AM GMT, Benno Lossin wrote:
> From: Antonio Hickey <contact@xxxxxxxxxxxxxxxxx>
>
> `feature(raw_ref_op)` became stable in Rust 1.82.0 which is the current
> MSRV of pin-init with no default features. Earlier Rust versions will
> now need to enable `raw_ref_op` to continue to work with pin-init.
>
> This reduces visual complexity and improves consistency with existing
> reference syntax.
>
> Suggested-by: Benno Lossin <lossin@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1148
> Closes: https://github.com/Rust-for-Linux/pin-init/issues/99
> Signed-off-by: Antonio Hickey <contact@xxxxxxxxxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/pin-init/commit/e27763004e2f6616b089437fbe9b3719cd72bd5c
> [ Reworded commit message. - Benno ]
> Signed-off-by: Benno Lossin <lossin@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
This version looks okay to me. Why is the linked upstream version adding
RUSTC_RAW_REF_OP_IS_STABLE cfg?
Best,
Gary
> ---
> rust/pin-init/README.md | 3 +--
> rust/pin-init/examples/big_struct_in_place.rs | 1 +
> rust/pin-init/examples/linked_list.rs | 1 +
> rust/pin-init/examples/mutex.rs | 1 +
> rust/pin-init/examples/pthread_mutex.rs | 1 +
> rust/pin-init/examples/static_init.rs | 1 +
> rust/pin-init/internal/src/init.rs | 8 ++++----
> rust/pin-init/src/lib.rs | 8 ++++----
> 8 files changed, 14 insertions(+), 10 deletions(-)