File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1163,7 +1163,9 @@ impl<T: ?Sized> RefCell<T> {
11631163 /// Since this method borrows `RefCell` mutably, it is statically guaranteed
11641164 /// that no borrows to the underlying data exist. The dynamic checks inherent
11651165 /// in [`borrow_mut`] and most other methods of `RefCell` are therefore
1166- /// unnecessary.
1166+ /// unnecessary. Note that this method does not reset the borrowing state if borrows were previously leaked
1167+ /// (e.g., via [`forget()`] on a [`Ref`] or [`RefMut`]). For that purpose,
1168+ /// consider using the unstable [`undo_leak`] method.
11671169 ///
11681170 /// This method can only be called if `RefCell` can be mutably borrowed,
11691171 /// which in general is only the case directly after the `RefCell` has
@@ -1174,6 +1176,8 @@ impl<T: ?Sized> RefCell<T> {
11741176 /// Use [`borrow_mut`] to get mutable access to the underlying data then.
11751177 ///
11761178 /// [`borrow_mut`]: RefCell::borrow_mut()
1179+ /// [`forget()`]: mem::forget
1180+ /// [`undo_leak`]: RefCell::undo_leak()
11771181 ///
11781182 /// # Examples
11791183 ///
You can’t perform that action at this time.
0 commit comments