Relax the safety condition for get_mut_unchecked
This commit is contained in:
parent
810dfd7cd4
commit
7a641f7c51
2 changed files with 8 additions and 4 deletions
|
@ -719,8 +719,10 @@ impl<T: ?Sized> Rc<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 @@ impl<T: ?Sized> Arc<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
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue