Skip to content

Commit f8c2d57

Browse files
committed
Auto merge of #30696 - steveklabnik:gh30655, r=brson
Fixes #30655
2 parents 84157db + 3385fba commit f8c2d57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libcore/ops.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ use fmt;
9595
#[stable(feature = "rust1", since = "1.0.0")]
9696
pub trait Drop {
9797
/// A method called when the value goes out of scope.
98+
///
99+
/// When this method has been called, `self` has not yet been deallocated.
100+
/// If it were, `self` would be a dangling reference.
101+
///
102+
/// After this function is over, the memory of `self` will be deallocated.
103+
///
104+
/// # Panics
105+
///
106+
/// Given that a `panic!` will call `drop()` as it unwinds, any `panic!` in
107+
/// a `drop()` implementation will likely abort.
98108
#[stable(feature = "rust1", since = "1.0.0")]
99109
fn drop(&mut self);
100110
}

0 commit comments

Comments
 (0)