We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb3c4ee commit 7cadf7bCopy full SHA for 7cadf7b
library/core/src/cell.rs
@@ -488,6 +488,13 @@ impl<T: ?Sized> Cell<T> {
488
/// This call borrows `Cell` mutably (at compile-time) which guarantees
489
/// that we possess the only reference.
490
///
491
+ /// However be cautious: this method expects `self` to be mutable, which is
492
+ /// generally not the case when using a `Cell`. If you require interior
493
+ /// mutability by reference, consider using `RefCell` which provides
494
+ /// run-time checked mutable borrows through its [`borrow_mut`] method.
495
+ ///
496
+ /// [`borrow_mut`]: RefCell::borrow_mut()
497
498
/// # Examples
499
500
/// ```
0 commit comments