Skip to content

Commit 0db955a

Browse files
authored
Unrolled build for rust-lang#134229
Rollup merge of rust-lang#134229 - purplesyringa:provenance-docs, r=saethlin Fix typos in docs on provenance This is related to [strict provenance](rust-lang#95228). Added a couple cross-refs, also replaced > Create a pointer without provenance from just an address (see [`ptr::dangling`]). with > Create a pointer without provenance from just an address (see [`without_provenance`]). as this method actually takes an address.
2 parents 327c7ee + 6ce7ba4 commit 0db955a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/core/src/ptr/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
//!
201201
//! But it *is* still sound to:
202202
//!
203-
//! * Create a pointer without provenance from just an address (see [`ptr::dangling`]). Such a
203+
//! * Create a pointer without provenance from just an address (see [`without_provenance`]). Such a
204204
//! pointer cannot be used for memory accesses (except for zero-sized accesses). This can still be
205205
//! useful for sentinel values like `null` *or* to represent a tagged pointer that will never be
206206
//! dereferenceable. In general, it is always sound for an integer to pretend to be a pointer "for
@@ -314,8 +314,8 @@
314314
//! }
315315
//! ```
316316
//!
317-
//! (Yes, if you've been using AtomicUsize for pointers in concurrent datastructures, you should
318-
//! be using AtomicPtr instead. If that messes up the way you atomically manipulate pointers,
317+
//! (Yes, if you've been using [`AtomicUsize`] for pointers in concurrent datastructures, you should
318+
//! be using [`AtomicPtr`] instead. If that messes up the way you atomically manipulate pointers,
319319
//! we would like to know why, and what needs to be done to fix it.)
320320
//!
321321
//! Situations where a valid pointer *must* be created from just an address, such as baremetal code
@@ -381,7 +381,8 @@
381381
//! [`with_addr`]: pointer::with_addr
382382
//! [`map_addr`]: pointer::map_addr
383383
//! [`addr`]: pointer::addr
384-
//! [`ptr::dangling`]: core::ptr::dangling
384+
//! [`AtomicUsize`]: crate::sync::atomic::AtomicUsize
385+
//! [`AtomicPtr`]: crate::sync::atomic::AtomicPtr
385386
//! [`expose_provenance`]: pointer::expose_provenance
386387
//! [`with_exposed_provenance`]: with_exposed_provenance
387388
//! [Miri]: https://github.com/rust-lang/miri

0 commit comments

Comments
 (0)