about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/cell.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 0b7389b2019..c4d0bec83ea 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -258,6 +258,9 @@ impl<T> RefCell<T> {
     /// Consumes the `RefCell`, returning the wrapped value.
     #[unstable = "may be renamed, depending on global conventions"]
     pub fn unwrap(self) -> T {
+        // Since this function takes `self` (the `RefCell`) by value, the
+        // compiler statically verifies that it is not currently borrowed.
+        // Therefore the following assertion is just a `debug_assert!`.
         debug_assert!(self.borrow.get() == UNUSED);
         unsafe{self.value.unwrap()}
     }