diff options
| author | Ralf Jung <post@ralfj.de> | 2023-12-01 08:35:23 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-12-01 08:35:23 +0100 |
| commit | f2dc18d0a1183bb7f9f8ff09f3c1abcd85ae851a (patch) | |
| tree | bcd5b9d968ba17c5aa8cf140cbb6b8cdaa1bd292 | |
| parent | dbea549d80674928c53fdbed3cffbc1052559330 (diff) | |
| download | rust-f2dc18d0a1183bb7f9f8ff09f3c1abcd85ae851a.tar.gz rust-f2dc18d0a1183bb7f9f8ff09f3c1abcd85ae851a.zip | |
update addr docs
| -rw-r--r-- | library/core/src/ptr/const_ptr.rs | 8 | ||||
| -rw-r--r-- | library/core/src/ptr/mut_ptr.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 8c9ffd18d99..5b5284d8c4c 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -186,10 +186,10 @@ impl<T: ?Sized> *const T { /// [`with_addr`][pointer::with_addr] or [`map_addr`][pointer::map_addr]. /// /// If using those APIs is not possible because there is no way to preserve a pointer with the - /// required provenance, use [`expose_addr`][pointer::expose_addr] and - /// [`from_exposed_addr`][from_exposed_addr] instead. However, note that this makes - /// your code less portable and less amenable to tools that check for compliance with the Rust - /// memory model. + /// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts + /// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr] + /// instead. However, note that this makes your code less portable and less amenable to tools + /// that check for compliance with the Rust memory model. /// /// On most platforms this will produce a value with the same bytes as the original /// pointer, because all the bytes are dedicated to describing the address. diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 194492a300b..a9208698a29 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -193,10 +193,10 @@ impl<T: ?Sized> *mut T { /// [`with_addr`][pointer::with_addr] or [`map_addr`][pointer::map_addr]. /// /// If using those APIs is not possible because there is no way to preserve a pointer with the - /// required provenance, use [`expose_addr`][pointer::expose_addr] and - /// [`from_exposed_addr_mut`][from_exposed_addr_mut] instead. However, note that this makes - /// your code less portable and less amenable to tools that check for compliance with the Rust - /// memory model. + /// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts + /// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr] + /// instead. However, note that this makes your code less portable and less amenable to tools + /// that check for compliance with the Rust memory model. /// /// On most platforms this will produce a value with the same bytes as the original /// pointer, because all the bytes are dedicated to describing the address. |
