Skip to content

Commit 249fa89

Browse files
committed
docs(wrapping_offset): move footnote to parenthetical
1 parent 56d6017 commit 249fa89

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

library/core/src/ptr/const_ptr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,9 @@ 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"[^1] the [allocated object] that `self` points to; it must not
487-
/// be used to read or write other allocated objects.
486+
/// The resulting pointer "remembers" the [allocated object] that `self` points to
487+
/// (This is called "[Provenance](ptr/index.html#provenance)").
488+
/// The pointer must not be used to read or write other allocated objects.
488489
///
489490
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
490491
/// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
@@ -504,7 +505,6 @@ impl<T: ?Sized> *const T {
504505
///
505506
/// [`offset`]: #method.offset
506507
/// [allocated object]: crate::ptr#allocated-object
507-
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
508508
///
509509
/// # Examples
510510
///

library/core/src/ptr/mut_ptr.rs

+3-3
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"[^1] 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
@@ -503,7 +504,6 @@ impl<T: ?Sized> *mut T {
503504
///
504505
/// [`offset`]: #method.offset
505506
/// [allocated object]: crate::ptr#allocated-object
506-
/// [^1]: This is called "[Provenance](ptr/index.html#provenance)"
507507
///
508508
/// # Examples
509509
///

0 commit comments

Comments
 (0)