Remove incorrect comments in Weak
It is currently possible to create a dangling `Weak` to a DST by calling `Weak::new()` for a sized type, then doing an unsized coercion. Therefore, the comments are wrong. These comments were added in <https://github.com/rust-lang/rust/pull/73845>. As far as I can tell, the guarantee in the comment was only previously used in the `as_ptr` method. However, the current implementation of `as_ptr` no longer relies on this guarantee.
This commit is contained in:
parent
d1d8e386c5
commit
644469e961
2 changed files with 0 additions and 2 deletions
|
|
@ -3004,7 +3004,6 @@ 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 RcInner has alignment at least 2.
|
||||
// This is only possible when `T: Sized`; unsized `T` never dangle.
|
||||
ptr: NonNull<RcInner<T>>,
|
||||
alloc: A,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -342,7 +342,6 @@ 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 RcInner has alignment at least 2.
|
||||
// This is only possible when `T: Sized`; unsized `T` never dangle.
|
||||
ptr: NonNull<ArcInner<T>>,
|
||||
alloc: A,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue