172172//! # #![feature(extern_types)]
173173//! use pin_init::{pin_data, pinned_drop, PinInit, PinnedDrop, pin_init_from_closure};
174174//! use core::{
175- //! ptr::addr_of_mut,
176175//! marker::PhantomPinned,
177176//! cell::UnsafeCell,
178177//! pin::Pin,
211210//! unsafe {
212211//! pin_init_from_closure(move |slot: *mut Self| {
213212//! // `slot` contains uninit memory, avoid creating a reference.
214- //! let foo = addr_of_mut!(( *slot).foo) ;
213+ //! let foo = &raw mut ( *slot).foo;
215214//! let foo = UnsafeCell::raw_get(foo).cast::<bindings::foo>();
216215//!
217216//! // Initialize the `foo`
265264//! [Rust-for-Linux]: https://rust-for-linux.com/
266265
267266#![ cfg_attr( USE_RUSTC_FEATURES , feature( lint_reasons) ) ]
267+ #![ cfg_attr( USE_RUSTC_FEATURES , feature( raw_ref_op) ) ]
268268#![ cfg_attr(
269269 all( any( feature = "alloc" , feature = "std" ) , USE_RUSTC_FEATURES ) ,
270270 feature( new_uninit)
@@ -754,7 +754,7 @@ macro_rules! stack_try_pin_init {
754754///
755755/// ```rust
756756/// # use pin_init::*;
757- /// # use core::{ptr::addr_of_mut, marker::PhantomPinned} ;
757+ /// # use core::marker::PhantomPinned;
758758/// #[pin_data]
759759/// #[derive(Zeroable)]
760760/// struct Buf {
@@ -768,7 +768,7 @@ macro_rules! stack_try_pin_init {
768768/// let init = pin_init!(&this in Buf {
769769/// buf: [0; 64],
770770/// // SAFETY: TODO.
771- /// ptr: unsafe { addr_of_mut!( (*this.as_ptr()).buf).cast() },
771+ /// ptr: unsafe { (&raw mut (*this.as_ptr()).buf).cast() },
772772/// pin: PhantomPinned,
773773/// });
774774/// let init = pin_init!(Buf {
0 commit comments