提交 63c77214 编写于 作者: B bors

Auto merge of #40634 - GuillaumeGomez:refcell-docs, r=steveklabnik

Add more explanation on RefCell::get_mut

Fixes #40203.

r? @rust-lang/docs
......@@ -725,6 +725,15 @@ pub fn as_ptr(&self) -> *mut 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
///
/// ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册