diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 835df66d55c4..fccdfa0dca92 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1641,6 +1641,7 @@ pub struct Weak { // `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>, } diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 875bec5b2037..ac3ce2255c89 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -267,6 +267,7 @@ pub struct Weak { // `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>, }