Skip to content

Commit 18a2985

Browse files
committed
cross-reference 'derived from' with provenance docs
1 parent f3df34f commit 18a2985

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

library/core/src/ptr/const_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<T: ?Sized> *const T {
352352
///
353353
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
354354
///
355-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
355+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
356356
/// [allocated object], and the entire memory range between `self` and the result must be in
357357
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
358358
/// of the address space.
@@ -556,7 +556,7 @@ impl<T: ?Sized> *const T {
556556
/// * `self` and `origin` must either
557557
///
558558
/// * point to the same address, or
559-
/// * both be *derived from* a pointer to the same [allocated object], and the memory range between
559+
/// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocated object], and the memory range between
560560
/// the two pointers must be in bounds of that object. (See below for an example.)
561561
///
562562
/// * The distance between the pointers, in bytes, must be an exact multiple
@@ -813,7 +813,7 @@ impl<T: ?Sized> *const T {
813813
///
814814
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
815815
///
816-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
816+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
817817
/// [allocated object], and the entire memory range between `self` and the result must be in
818818
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
819819
/// of the address space.
@@ -887,7 +887,7 @@ impl<T: ?Sized> *const T {
887887
///
888888
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
889889
///
890-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
890+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
891891
/// [allocated object], and the entire memory range between `self` and the result must be in
892892
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
893893
/// of the address space.

library/core/src/ptr/mut_ptr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<T: ?Sized> *mut T {
349349
///
350350
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
351351
///
352-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
352+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
353353
/// [allocated object], and the entire memory range between `self` and the result must be in
354354
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
355355
/// of the address space.
@@ -720,7 +720,7 @@ impl<T: ?Sized> *mut T {
720720
/// * `self` and `origin` must either
721721
///
722722
/// * point to the same address, or
723-
/// * both be *derived from* a pointer to the same [allocated object], and the memory range between
723+
/// * both be [derived from][crate::ptr#provenance] a pointer to the same [allocated object], and the memory range between
724724
/// the two pointers must be in bounds of that object. (See below for an example.)
725725
///
726726
/// * The distance between the pointers, in bytes, must be an exact multiple
@@ -893,7 +893,7 @@ impl<T: ?Sized> *mut T {
893893
///
894894
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
895895
///
896-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
896+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
897897
/// [allocated object], and the entire memory range between `self` and the result must be in
898898
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
899899
/// of the address space.
@@ -967,7 +967,7 @@ impl<T: ?Sized> *mut T {
967967
///
968968
/// * The computed offset, `count * size_of::<T>()` bytes, must not overflow `isize`.
969969
///
970-
/// * If the computed offset is non-zero, then `self` must be derived from a pointer to some
970+
/// * If the computed offset is non-zero, then `self` must be [derived from][crate::ptr#provenance] a pointer to some
971971
/// [allocated object], and the entire memory range between `self` and the result must be in
972972
/// bounds of that allocated object. In particular, this range must not "wrap around" the edge
973973
/// of the address space.

0 commit comments

Comments
 (0)