1
Fork 0

Relax the safety condition for get_mut_unchecked

This commit is contained in:
Simon Sapin 2019-08-16 17:45:44 +02:00
parent 810dfd7cd4
commit 7a641f7c51
2 changed files with 8 additions and 4 deletions

View file

@ -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
///

View file

@ -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
///