Skip to content
Permalink
Browse files

Relax the safety condition for get_mut_unchecked

  • Loading branch information...
SimonSapin committed Aug 16, 2019
1 parent 810dfd7 commit 7a641f7c516ac666c72bf9edfbec8648aa0160c7
Showing with 8 additions and 4 deletions.
  1. +4 −2 src/liballoc/rc.rs
  2. +4 −2 src/liballoc/sync.rs
@@ -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
///

0 comments on commit 7a641f7

Please sign in to comment.
You can’t perform that action at this time.