We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 846891a + 3ad844c commit 63c7721Copy full SHA for 63c7721
src/libcore/cell.rs
@@ -725,6 +725,15 @@ impl<T: ?Sized> RefCell<T> {
725
/// This call borrows `RefCell` mutably (at compile-time) so there is no
726
/// need for dynamic checks.
727
///
728
+ /// However be cautious: this method expects `self` to be mutable, which is
729
+ /// generally not the case when using a `RefCell`. Take a look at the
730
+ /// [`borrow_mut`] method instead if `self` isn't mutable.
731
+ ///
732
+ /// Also, please be aware that this method is only for special circumstances and is usually
733
+ /// not you want. In case of doubt, use [`borrow_mut`] instead.
734
735
+ /// [`borrow_mut`]: #method.borrow_mut
736
737
/// # Examples
738
739
/// ```
0 commit comments