Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Auto merge of #40634 - GuillaumeGomez:refcell-docs, r=steveklabnik
Browse files Browse the repository at this point in the history
Add more explanation on RefCell::get_mut

Fixes #40203.

r? @rust-lang/docs
  • Loading branch information
bors committed Apr 24, 2017
2 parents 846891a + 3ad844c commit 63c7721
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,15 @@ impl<T: ?Sized> RefCell<T> {
/// This call borrows `RefCell` mutably (at compile-time) so there is no
/// need for dynamic checks.
///
/// However be cautious: this method expects `self` to be mutable, which is
/// generally not the case when using a `RefCell`. Take a look at the
/// [`borrow_mut`] method instead if `self` isn't mutable.
///
/// Also, please be aware that this method is only for special circumstances and is usually
/// not you want. In case of doubt, use [`borrow_mut`] instead.
///
/// [`borrow_mut`]: #method.borrow_mut
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit 63c7721

Please sign in to comment.