Skip to content

Commit 14625f5

Browse files
committed
consistent wording
1 parent 39b53dc commit 14625f5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: library/core/src/ptr/const_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,8 @@ impl<T: ?Sized> *const T {
648648
/// such large allocations either.)
649649
///
650650
/// The requirement for pointers to be derived from the same allocated object is primarily
651-
/// needed for `const`-compatibility: at compile-time, pointers into *different* allocated
652-
/// objects do not have a known distance to each other. However, the requirement also exists at
651+
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
652+
/// objects is not known at compile-time. However, the requirement also exists at
653653
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
654654
/// pointers that are not guaranteed to be from the same allocation, use `(self as
655655
/// usize).sub(origin as usize) / mem::size_of::<T>()`.

Diff for: library/core/src/ptr/mut_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ impl<T: ?Sized> *mut T {
822822
/// such large allocations either.)
823823
///
824824
/// The requirement for pointers to be derived from the same allocated object is primarily
825-
/// needed for `const`-compatibility: at compile-time, pointers into *different* allocated
826-
/// objects do not have a known distance to each other. However, the requirement also exists at
825+
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
826+
/// objects is not known at compile-time. However, the requirement also exists at
827827
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
828828
/// pointers that are not guaranteed to be from the same allocation, use `(self as
829829
/// usize).sub(origin as usize) / mem::size_of::<T>()`.

0 commit comments

Comments
 (0)