Skip to content

Commit aeec053

Browse files
authored
Rollup merge of #139192 - lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung
mention provenance in the pointer::wrapping_offset docs fixes #139008
2 parents e897144 + 851decd commit aeec053

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

library/core/src/ptr/const_ptr.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,9 @@ impl<T: ?Sized> *const T {
484484
///
485485
/// This operation itself is always safe, but using the resulting pointer is not.
486486
///
487-
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
488-
/// be used to read or write other allocated objects.
487+
/// The resulting pointer "remembers" the [allocated object] that `self` points to
488+
/// (this is called "[Provenance](ptr/index.html#provenance)").
489+
/// The pointer must not be used to read or write other allocated objects.
489490
///
490491
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
491492
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still

library/core/src/ptr/mut_ptr.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,9 @@ 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
486-
/// be used to read or write other allocated objects.
485+
/// The resulting pointer "remembers" the [allocated object] that `self` points to
486+
/// (this is called "[Provenance](ptr/index.html#provenance)").
487+
/// The pointer must not be used to read or write other allocated objects.
487488
///
488489
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
489490
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still

0 commit comments

Comments
 (0)