Skip to content

Commit f2dc18d

Browse files
committed
update addr docs
1 parent dbea549 commit f2dc18d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

library/core/src/ptr/const_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ impl<T: ?Sized> *const T {
186186
/// [`with_addr`][pointer::with_addr] or [`map_addr`][pointer::map_addr].
187187
///
188188
/// If using those APIs is not possible because there is no way to preserve a pointer with the
189-
/// required provenance, use [`expose_addr`][pointer::expose_addr] and
190-
/// [`from_exposed_addr`][from_exposed_addr] instead. However, note that this makes
191-
/// your code less portable and less amenable to tools that check for compliance with the Rust
192-
/// memory model.
189+
/// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts
190+
/// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr]
191+
/// instead. However, note that this makes your code less portable and less amenable to tools
192+
/// that check for compliance with the Rust memory model.
193193
///
194194
/// On most platforms this will produce a value with the same bytes as the original
195195
/// pointer, because all the bytes are dedicated to describing the address.

library/core/src/ptr/mut_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ impl<T: ?Sized> *mut T {
193193
/// [`with_addr`][pointer::with_addr] or [`map_addr`][pointer::map_addr].
194194
///
195195
/// If using those APIs is not possible because there is no way to preserve a pointer with the
196-
/// required provenance, use [`expose_addr`][pointer::expose_addr] and
197-
/// [`from_exposed_addr_mut`][from_exposed_addr_mut] instead. However, note that this makes
198-
/// your code less portable and less amenable to tools that check for compliance with the Rust
199-
/// memory model.
196+
/// required provenance, then Strict Provenance might not be for you. Use pointer-integer casts
197+
/// or [`expose_addr`][pointer::expose_addr] and [`from_exposed_addr`][from_exposed_addr]
198+
/// instead. However, note that this makes your code less portable and less amenable to tools
199+
/// that check for compliance with the Rust memory model.
200200
///
201201
/// On most platforms this will produce a value with the same bytes as the original
202202
/// pointer, because all the bytes are dedicated to describing the address.

0 commit comments

Comments
 (0)