diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 1d4ce8e2682..0a2fe46e3ff 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1860,7 +1860,7 @@ impl Weak { let offset = unsafe { data_offset(ptr) }; // Reverse the offset to find the original RcBox. - // SAFETY: we use wrapping_offset here because the pointer may be dangling (iff T: Sized). + // SAFETY: we use wrapping_offset here because the pointer may be dangling (but only if T: Sized). let ptr = unsafe { set_data_ptr(ptr as *mut RcBox, (ptr as *mut u8).wrapping_offset(-offset)) }; diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index f064881717d..f7873b34c44 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1643,7 +1643,7 @@ impl Weak { let offset = unsafe { data_offset(ptr) }; // Reverse the offset to find the original ArcInner. - // SAFETY: we use wrapping_offset here because the pointer may be dangling (iff T: Sized) + // SAFETY: we use wrapping_offset here because the pointer may be dangling (but only if T: Sized) let ptr = unsafe { set_data_ptr(ptr as *mut ArcInner, (ptr as *mut u8).wrapping_offset(-offset)) };