Skip to content

Commit 062ca74

Browse files
borsgitbot
authored and
gitbot
committed
Auto merge of rust-lang#134640 - matthiaskrgr:rollup-xlstm3o, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#134364 (Use E0665 for missing `#[default]` on enum and update doc) - rust-lang#134601 (Support pretty-printing `dyn*` trait objects) - rust-lang#134603 (Explain why a type is not eligible for `impl PointerLike`.) - rust-lang#134618 (coroutine_clone: add comments) - rust-lang#134630 (Use `&raw` for `ptr` primitive docs) - rust-lang#134637 (Flatten effects directory now that it doesn't really test anything specific) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6ee934f + c3da405 commit 062ca74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: core/src/primitive_docs.rs

+5-5
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)