about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThinkChaos <ThinkChaos@users.noreply.github.com>2020-05-03 12:52:23 +0200
committerThinkChaos <ThinkChaos@users.noreply.github.com>2020-05-03 12:52:23 +0200
commit4a79424b748338bd9635f0115c025942af2d5c3d (patch)
tree9e3d8f217b73fcfba23ace5b9bcf15754a211ff2
parent4ea83bfb3d457770f2e54965dd86f672fbbc87c2 (diff)
downloadrust-4a79424b748338bd9635f0115c025942af2d5c3d.tar.gz
rust-4a79424b748338bd9635f0115c025942af2d5c3d.zip
Mention `RefCell::take` can panic in docs
-rw-r--r--src/libcore/cell.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 05c9c97a612..0f2665eba6f 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -1026,6 +1026,10 @@ impl<T: ?Sized> RefCell<T> {
 impl<T: Default> RefCell<T> {
     /// Takes the wrapped value, leaving `Default::default()` in its place.
     ///
+    /// # Panics
+    ///
+    /// Panics if the value is currently borrowed.
+    ///
     /// # Examples
     ///
     /// ```