Skip to content

Commit

Permalink
Rollup merge of rust-lang#35710 - matthew-piziak:explicit-drop, r=ste…
Browse files Browse the repository at this point in the history
…veklabnik

note that calling drop() explicitly is a compiler error

Part of rust-lang#29365
  • Loading branch information
Jonathan Turner authored Aug 20, 2016
2 parents f4aa376 + a516dbb commit 7fc927f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ pub trait Drop {
///
/// After this function is over, the memory of `self` will be deallocated.
///
/// This function cannot be called explicitly. This is compiler error
/// [0040]. However, the [`std::mem::drop`] function in the prelude can be
/// used to call the argument's `Drop` implementation.
///
/// [0040]: https://doc.rust-lang.org/error-index.html#E0040
/// [`std::mem::drop`]: https://doc.rust-lang.org/std/mem/fn.drop.html
///
/// # Panics
///
/// Given that a `panic!` will call `drop()` as it unwinds, any `panic!` in
Expand Down

0 comments on commit 7fc927f

Please sign in to comment.