提交 7a641f7c 编写于 作者: S Simon Sapin

Relax the safety condition for get_mut_unchecked

上级 810dfd7c
......@@ -719,8 +719,10 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> {
///
/// # Safety
///
/// There must be no other `Rc` or [`Weak`] pointers to the same value.
/// This is the case for example immediately after `Rc::new`.
/// Any other `Rc` or [`Weak`] pointers to the same value must not be dereferenced
/// for the duration of the returned borrow.
/// This is trivially the case if no such pointer exist,
/// for example immediately after `Rc::new`.
///
/// # Examples
///
......
......@@ -1104,8 +1104,10 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> {
///
/// # Safety
///
/// There must be no other `Arc` or [`Weak`] pointers to the same value.
/// This is the case for example immediately after `Rc::new`.
/// Any other `Arc` or [`Weak`] pointers to the same value must not be dereferenced
/// for the duration of the returned borrow.
/// This is trivially the case if no such pointer exist,
/// for example immediately after `Arc::new`.
///
/// # Examples
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册