diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 4d77779b209..835df66d55c 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1705,9 +1705,9 @@ impl<T> Weak<T> { let ptr: *mut RcBox<T> = 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 160abe7210c..875bec5b203 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -1473,9 +1473,9 @@ impl<T> Weak<T> { let ptr: *mut ArcInner<T> = 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 { |
