about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-19 16:44:54 +0200
committerRalf Jung <post@ralfj.de>2023-09-21 08:27:10 +0200
commit14625f5b3ec9730bef12c63f7d4fb4c43d118d7a (patch)
tree79f7471ea551a0d52f3a0278ca2c53683e5253a5
parent39b53dc204e944e37fef621d4799a561f423cfd3 (diff)
downloadrust-14625f5b3ec9730bef12c63f7d4fb4c43d118d7a.tar.gz
rust-14625f5b3ec9730bef12c63f7d4fb4c43d118d7a.zip
consistent wording
-rw-r--r--library/core/src/ptr/const_ptr.rs4
-rw-r--r--library/core/src/ptr/mut_ptr.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index 97aa3015bf1..0f589647a47 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -648,8 +648,8 @@ impl<T: ?Sized> *const T {
     /// such large allocations either.)
     ///
     /// The requirement for pointers to be derived from the same allocated object is primarily
-    /// needed for `const`-compatibility: at compile-time, pointers into *different* allocated
-    /// objects do not have a known distance to each other. However, the requirement also exists at
+    /// needed for `const`-compatibility: the distance between pointers into *different* allocated
+    /// objects is not known at compile-time. However, the requirement also exists at
     /// runtime and may be exploited by optimizations. If you wish to compute the difference between
     /// pointers that are not guaranteed to be from the same allocation, use `(self as
     /// usize).sub(origin as usize) / mem::size_of::<T>()`.
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index 2f21319d559..d395319b6f3 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -822,8 +822,8 @@ impl<T: ?Sized> *mut T {
     /// such large allocations either.)
     ///
     /// The requirement for pointers to be derived from the same allocated object is primarily
-    /// needed for `const`-compatibility: at compile-time, pointers into *different* allocated
-    /// objects do not have a known distance to each other. However, the requirement also exists at
+    /// needed for `const`-compatibility: the distance between pointers into *different* allocated
+    /// objects is not known at compile-time. However, the requirement also exists at
     /// runtime and may be exploited by optimizations. If you wish to compute the difference between
     /// pointers that are not guaranteed to be from the same allocation, use `(self as
     /// usize).sub(origin as usize) / mem::size_of::<T>()`.