File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -563,11 +563,11 @@ impl () {}
563563/// Note that here the call to [`drop`] is for clarity - it indicates
564564/// that we are done with the given value and it should be destroyed.
565565///
566- /// ## 3. Create it using `ptr::addr_of! `
566+ /// ## 3. Create it using `&raw `
567567///
568- /// Instead of coercing a reference to a raw pointer, you can use the macros
569- /// [`ptr::addr_of!`] (for `*const T`) and [`ptr::addr_of_mut!`] (for `*mut T`).
570- /// These macros allow you to create raw pointers to fields to which you cannot
568+ /// Instead of coercing a reference to a raw pointer, you can use the raw borrow
569+ /// operators `&raw const` (for `*const T`) and `&raw mut` (for `*mut T`).
570+ /// These operators allow you to create raw pointers to fields to which you cannot
571571/// create a reference (without causing undefined behavior), such as an
572572/// unaligned field. This might be necessary if packed structs or uninitialized
573573/// memory is involved.
@@ -580,7 +580,7 @@ impl () {}
580580/// unaligned: u32,
581581/// }
582582/// let s = S::default();
583- /// let p = std::ptr::addr_of!( s.unaligned) ; // not allowed with coercion
583+ /// let p = &raw const s.unaligned; // not allowed with coercion
584584/// ```
585585///
586586/// ## 4. Get it from C.
You can’t perform that action at this time.
0 commit comments