mention provenance in the pointer::wrapping_offset docs

fixes https://github.com/rust-lang/rust/issues/139008
This commit is contained in:
binarycat 2025-03-31 14:43:24 -05:00
parent 90f5eab952
commit 56d6017bad
2 changed files with 4 additions and 2 deletions

View File

@ -483,7 +483,7 @@ impl<T: ?Sized> *const T {
///
/// This operation itself is always safe, but using the resulting pointer is not.
///
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not
/// be used to read or write other allocated objects.
///
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
@ -504,6 +504,7 @@ impl<T: ?Sized> *const T {
///
/// [`offset`]: #method.offset
/// [allocated object]: crate::ptr#allocated-object
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
///
/// # Examples
///

View File

@ -482,7 +482,7 @@ impl<T: ?Sized> *mut T {
///
/// This operation itself is always safe, but using the resulting pointer is not.
///
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not
/// be used to read or write other allocated objects.
///
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
@ -503,6 +503,7 @@ impl<T: ?Sized> *mut T {
///
/// [`offset`]: #method.offset
/// [allocated object]: crate::ptr#allocated-object
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
///
/// # Examples
///