about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-20 07:09:34 -0700
committerGitHub <noreply@github.com>2016-08-20 07:09:34 -0700
commitba8611ee3831214e834a69133b291d1fd0774592 (patch)
treebd73f3086f6d7d86537a67937940cfd7c6552f4a /src/libcore
parented9a18a7c722106b9f4e7677523152ab65e1287c (diff)
parenta516dbb7d946fc26ed036ae4bd23f4c7abdff3a2 (diff)
Rollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik
note that calling drop() explicitly is a compiler error

Part of #29365
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ops.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index d6db3c7fdb6..4ba5993fc61 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -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