diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2016-03-10 14:01:54 +0300 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2016-03-10 14:01:54 +0300 |
| commit | 76bcf6430f0629931bbbc5c28d2e54a888bdea93 (patch) | |
| tree | 7a8f1c87b37bb5a4608168ee31103f40a39bc9da /src/liballoc | |
| parent | d6c4b53df1ee7ff1eff343224d502169566b03cc (diff) | |
| parent | df550de689c27803c9b8d961c747e09cca36fd3e (diff) | |
| download | rust-76bcf6430f0629931bbbc5c28d2e54a888bdea93.tar.gz rust-76bcf6430f0629931bbbc5c28d2e54a888bdea93.zip | |
Rollup merge of #32147 - steveklabnik:gh31950, r=bluss
Clarify that try_unwrap needs exactly one Fixes #31950
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 5 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 74325afaebd..b5d7279edb0 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -201,11 +201,12 @@ impl<T> Arc<T> { Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } } } - /// Unwraps the contained value if the `Arc<T>` has only one strong reference. - /// This will succeed even if there are outstanding weak references. + /// Unwraps the contained value if the `Arc<T>` has exactly one strong reference. /// /// Otherwise, an `Err` is returned with the same `Arc<T>`. /// + /// This will succeed even if there are outstanding weak references. + /// /// # Examples /// /// ``` diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 162312e2457..dc283f5acdf 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -224,11 +224,12 @@ impl<T> Rc<T> { } } - /// Unwraps the contained value if the `Rc<T>` has only one strong reference. - /// This will succeed even if there are outstanding weak references. + /// Unwraps the contained value if the `Rc<T>` has exactly one strong reference. /// /// Otherwise, an `Err` is returned with the same `Rc<T>`. /// + /// This will succeed even if there are outstanding weak references. + /// /// # Examples /// /// ``` |
