Rollup merge of #134229 - purplesyringa:provenance-docs, r=saethlin
Fix typos in docs on provenance This is related to [strict provenance](https://github.com/rust-lang/rust/issues/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.
This commit is contained in:
commit
8cce32ae2b
1 changed files with 5 additions and 4 deletions
|
@ -200,7 +200,7 @@
|
||||||
//!
|
//!
|
||||||
//! But it *is* still sound to:
|
//! But it *is* still sound to:
|
||||||
//!
|
//!
|
||||||
//! * Create a pointer without provenance from just an address (see [`ptr::dangling`]). Such a
|
//! * Create a pointer without provenance from just an address (see [`without_provenance`]). Such a
|
||||||
//! pointer cannot be used for memory accesses (except for zero-sized accesses). This can still be
|
//! pointer cannot be used for memory accesses (except for zero-sized accesses). This can still be
|
||||||
//! useful for sentinel values like `null` *or* to represent a tagged pointer that will never be
|
//! useful for sentinel values like `null` *or* to represent a tagged pointer that will never be
|
||||||
//! dereferenceable. In general, it is always sound for an integer to pretend to be a pointer "for
|
//! dereferenceable. In general, it is always sound for an integer to pretend to be a pointer "for
|
||||||
|
@ -314,8 +314,8 @@
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! (Yes, if you've been using AtomicUsize for pointers in concurrent datastructures, you should
|
//! (Yes, if you've been using [`AtomicUsize`] for pointers in concurrent datastructures, you should
|
||||||
//! be using AtomicPtr instead. If that messes up the way you atomically manipulate pointers,
|
//! be using [`AtomicPtr`] instead. If that messes up the way you atomically manipulate pointers,
|
||||||
//! we would like to know why, and what needs to be done to fix it.)
|
//! we would like to know why, and what needs to be done to fix it.)
|
||||||
//!
|
//!
|
||||||
//! Situations where a valid pointer *must* be created from just an address, such as baremetal code
|
//! Situations where a valid pointer *must* be created from just an address, such as baremetal code
|
||||||
|
@ -381,7 +381,8 @@
|
||||||
//! [`with_addr`]: pointer::with_addr
|
//! [`with_addr`]: pointer::with_addr
|
||||||
//! [`map_addr`]: pointer::map_addr
|
//! [`map_addr`]: pointer::map_addr
|
||||||
//! [`addr`]: pointer::addr
|
//! [`addr`]: pointer::addr
|
||||||
//! [`ptr::dangling`]: core::ptr::dangling
|
//! [`AtomicUsize`]: crate::sync::atomic::AtomicUsize
|
||||||
|
//! [`AtomicPtr`]: crate::sync::atomic::AtomicPtr
|
||||||
//! [`expose_provenance`]: pointer::expose_provenance
|
//! [`expose_provenance`]: pointer::expose_provenance
|
||||||
//! [`with_exposed_provenance`]: with_exposed_provenance
|
//! [`with_exposed_provenance`]: with_exposed_provenance
|
||||||
//! [Miri]: https://github.com/rust-lang/miri
|
//! [Miri]: https://github.com/rust-lang/miri
|
||||||
|
|
Loading…
Add table
Reference in a new issue