mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
mention provenance in the pointer::wrapping_offset docs
fixes https://github.com/rust-lang/rust/issues/139008
This commit is contained in:
parent
90f5eab952
commit
56d6017bad
@ -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
|
||||
///
|
||||
|
@ -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
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user