File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1163,7 +1163,9 @@ impl<T: ?Sized> RefCell<T> {
1163
1163
/// Since this method borrows `RefCell` mutably, it is statically guaranteed
1164
1164
/// that no borrows to the underlying data exist. The dynamic checks inherent
1165
1165
/// 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.
1167
1169
///
1168
1170
/// This method can only be called if `RefCell` can be mutably borrowed,
1169
1171
/// which in general is only the case directly after the `RefCell` has
@@ -1174,6 +1176,7 @@ impl<T: ?Sized> RefCell<T> {
1174
1176
/// Use [`borrow_mut`] to get mutable access to the underlying data then.
1175
1177
///
1176
1178
/// [`borrow_mut`]: RefCell::borrow_mut()
1179
+ /// [`forget()`]: mem::forget
1177
1180
///
1178
1181
/// # Examples
1179
1182
///
You can’t perform that action at this time.
0 commit comments