Skip to content

Commit

Permalink
Weak's type parameter may dangle on drop
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 21, 2021
1 parent c441675 commit 23a4050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/rc.rs
Expand Up @@ -2303,7 +2303,7 @@ impl<T: ?Sized> Weak<T> {
}

#[stable(feature = "rc_weak", since = "1.4.0")]
impl<T: ?Sized> Drop for Weak<T> {
unsafe impl<#[may_dangle] T: ?Sized> Drop for Weak<T> {
/// Drops the `Weak` pointer.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/sync.rs
Expand Up @@ -2015,7 +2015,7 @@ impl<T> Default for Weak<T> {
}

#[stable(feature = "arc_weak", since = "1.4.0")]
impl<T: ?Sized> Drop for Weak<T> {
unsafe impl<#[may_dangle] T: ?Sized> Drop for Weak<T> {
/// Drops the `Weak` pointer.
///
/// # Examples
Expand Down

0 comments on commit 23a4050

Please sign in to comment.