diff options
| -rw-r--r-- | src/liballoc/rc.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 835df66d55c..fccdfa0dca9 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1641,6 +1641,7 @@ pub struct Weak<T: ?Sized> { // `Weak::new` sets this to `usize::MAX` so that it doesn’t need // to allocate space on the heap. That's not a value a real pointer // will ever have because RcBox has alignment at least 2. + // This is only possible when `T: Sized`; unsized `T` never dangle. ptr: NonNull<RcBox<T>>, } diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 875bec5b203..ac3ce2255c8 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -267,6 +267,7 @@ pub struct Weak<T: ?Sized> { // `Weak::new` sets this to `usize::MAX` so that it doesn’t need // to allocate space on the heap. That's not a value a real pointer // will ever have because RcBox has alignment at least 2. + // This is only possible when `T: Sized`; unsized `T` never dangle. ptr: NonNull<ArcInner<T>>, } |
