diff options
| author | Matthew Piziak <matthew.piziak@gmail.com> | 2016-08-16 04:33:59 -0400 |
|---|---|---|
| committer | Matthew Piziak <matthew.piziak@gmail.com> | 2016-08-18 16:31:32 -0400 |
| commit | a516dbb7d946fc26ed036ae4bd23f4c7abdff3a2 (patch) | |
| tree | 802cf57b98a73472d61208d6c856d4598c22c4e2 /src/libcore | |
| parent | f65d96fe3fa3cfae2cfc88be40f7416a22c88bf2 (diff) | |
| download | rust-a516dbb7d946fc26ed036ae4bd23f4c7abdff3a2.tar.gz rust-a516dbb7d946fc26ed036ae4bd23f4c7abdff3a2.zip | |
note that calling drop() explicitly is a compiler error
Part of #29365 explain that std::mem::drop in prelude will invoke Drop change "prelude" -> "the prelude"; change links to reference-style move link references to links' section
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/ops.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 9347ac2a8c8..daa5ebb61f9 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -102,6 +102,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 |
