Skip to content

Commit 56d6017

Browse files
committed
mention provenance in the pointer::wrapping_offset docs
fixes rust-lang#139008
1 parent 90f5eab commit 56d6017

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

library/core/src/ptr/const_ptr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ impl<T: ?Sized> *const T {
483483
///
484484
/// This operation itself is always safe, but using the resulting pointer is not.
485485
///
486-
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
486+
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not
487487
/// be used to read or write other allocated objects.
488488
///
489489
/// 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 {
504504
///
505505
/// [`offset`]: #method.offset
506506
/// [allocated object]: crate::ptr#allocated-object
507+
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
507508
///
508509
/// # Examples
509510
///

library/core/src/ptr/mut_ptr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl<T: ?Sized> *mut T {
482482
///
483483
/// This operation itself is always safe, but using the resulting pointer is not.
484484
///
485-
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
485+
/// The resulting pointer "remembers"[^1] the [allocated object] that `self` points to; it must not
486486
/// be used to read or write other allocated objects.
487487
///
488488
/// 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 {
503503
///
504504
/// [`offset`]: #method.offset
505505
/// [allocated object]: crate::ptr#allocated-object
506+
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
506507
///
507508
/// # Examples
508509
///

0 commit comments

Comments
 (0)