about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorCAD97 <cad97@cad97.com>2021-01-07 12:41:58 -0500
committerCAD97 <cad97@cad97.com>2021-01-07 12:41:58 -0500
commitb10b9e25ffcb06077375960f07a0c6443184f07a (patch)
tree2010400bb1c2c28c33426aa38c7c6386fdd4324b /library/alloc/src
parentf00b45890311da955bf2081a0fab2837f3a36a4d (diff)
downloadrust-b10b9e25ffcb06077375960f07a0c6443184f07a.tar.gz
rust-b10b9e25ffcb06077375960f07a0c6443184f07a.zip
Remove "pointer describes" terminology
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/rc.rs9
-rw-r--r--library/alloc/src/sync.rs9
2 files changed, 8 insertions, 10 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index 61d70a62dca..7f500af59a8 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -1899,7 +1899,7 @@ impl<T: ?Sized> Weak<T> {
             // a valid pointer, so that `from_raw` can reverse this transformation.
             (ptr as *mut T).set_ptr_value(ptr::null_mut())
         } else {
-            // SAFETY: If the pointer is not dangling, it describes to a valid allocation.
+            // SAFETY: If the pointer is not dangling, it references a valid allocation.
             // The payload may be dropped at this point, and we have to maintain provenance,
             // so use raw pointer manipulation.
             unsafe { &raw mut (*ptr).value }
@@ -1991,8 +1991,8 @@ impl<T: ?Sized> Weak<T> {
             // SAFETY: this is the same sentinel as used in Weak::new and is_dangling
             (ptr as *mut RcBox<T>).set_ptr_value(usize::MAX as *mut _)
         } else {
-            // Otherwise, this describes a real allocation.
-            // SAFETY: data_offset is safe to call, as ptr describes a real allocation.
+            // Otherwise, this references a real allocation.
+            // SAFETY: data_offset is safe to call, as ptr references a real (potentially dropped) T.
             let offset = unsafe { data_offset(ptr) };
             // Thus, we reverse the offset to get the whole RcBox.
             // SAFETY: the pointer originated from a Weak, so this offset is safe.
@@ -2320,8 +2320,7 @@ impl<T: ?Sized> AsRef<T> for Rc<T> {
 #[stable(feature = "pin", since = "1.33.0")]
 impl<T: ?Sized> Unpin for Rc<T> {}
 
-/// Get the offset within an `RcBox` for
-/// a payload of type described by a pointer.
+/// Get the offset within an `RcBox` for the payload behind a pointer.
 ///
 /// # Safety
 ///
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index 1ca6b6d6335..e2811a5cd6c 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -1685,7 +1685,7 @@ impl<T: ?Sized> Weak<T> {
             // a valid pointer, so that `from_raw` can reverse this transformation.
             (ptr as *mut T).set_ptr_value(ptr::null_mut())
         } else {
-            // SAFETY: If the pointer is not dangling, it describes to a valid allocation.
+            // SAFETY: If the pointer is not dangling, it references a valid allocation.
             // The payload may be dropped at this point, and we have to maintain provenance,
             // so use raw pointer manipulation.
             unsafe { &raw mut (*ptr).data }
@@ -1777,8 +1777,8 @@ impl<T: ?Sized> Weak<T> {
             // SAFETY: this is the same sentinel as used in Weak::new and is_dangling
             (ptr as *mut ArcInner<T>).set_ptr_value(usize::MAX as *mut _)
         } else {
-            // Otherwise, this describes a real allocation.
-            // SAFETY: data_offset is safe to call, as ptr describes a real allocation.
+            // Otherwise, this references a real allocation.
+            // SAFETY: data_offset is safe to call, as ptr references a real (potentially dropped) T.
             let offset = unsafe { data_offset(ptr) };
             // Thus, we reverse the offset to get the whole RcBox.
             // SAFETY: the pointer originated from a Weak, so this offset is safe.
@@ -2471,8 +2471,7 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
 #[stable(feature = "pin", since = "1.33.0")]
 impl<T: ?Sized> Unpin for Arc<T> {}
 
-/// Get the offset within an `ArcInner` for
-/// a payload of type described by a pointer.
+/// Get the offset within an `ArcInner` for the payload behind a pointer.
 ///
 /// # Safety
 ///