Skip to content

Commit

Permalink
Relax the safety condition for get_mut_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Aug 16, 2019
1 parent 810dfd7 commit 7a641f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
6 changes: 4 additions & 2 deletions src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down

0 comments on commit 7a641f7

Please sign in to comment.