diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2019-08-16 17:45:44 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2019-08-16 17:45:44 +0200 |
| commit | 7a641f7c516ac666c72bf9edfbec8648aa0160c7 (patch) | |
| tree | a72fe192c18dc8e5a89d7169311d29e4b9698199 /src/liballoc/rc.rs | |
| parent | 810dfd7cd451c370d0c47d6aa9e62b16292a29e0 (diff) | |
Relax the safety condition for get_mut_unchecked
Diffstat (limited to 'src/liballoc/rc.rs')
| -rw-r--r-- | src/liballoc/rc.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index abb09684260..1509afa4889 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.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 /// |
