diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 4d77779b2091..835df66d55c4 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1705,9 +1705,9 @@ impl Weak { let ptr: *mut RcBox = NonNull::as_ptr(self.ptr); // SAFETY: we must offset the pointer manually, and said pointer may be - // a dangling weak (usize::MAX). data_offset is safe to call, because we - // know a pointer to unsized T must be derived from a real unsized T, - // because dangling weaks are only created for sized T. wrapping_offset + // a dangling weak (usize::MAX) if T is sized. data_offset is safe to call, + // because we know that a pointer to unsized T was derived from a real + // unsized T, as dangling weaks are only created for sized T. wrapping_offset // is used so that we can use the same code path for the non-dangling // unsized case and the potentially dangling sized case. unsafe { diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 160abe7210c7..875bec5b2037 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -1473,9 +1473,9 @@ impl Weak { let ptr: *mut ArcInner = NonNull::as_ptr(self.ptr); // SAFETY: we must offset the pointer manually, and said pointer may be - // a dangling weak (usize::MAX). data_offset is safe to call, because we - // know a pointer to unsized T must be derived from a real unsized T, - // because dangling weaks are only created for sized T. wrapping_offset + // a dangling weak (usize::MAX) if T is sized. data_offset is safe to call, + // because we know that a pointer to unsized T was derived from a real + // unsized T, as dangling weaks are only created for sized T. wrapping_offset // is used so that we can use the same code path for the non-dangling // unsized case and the potentially dangling sized case. unsafe {