Skip to content

Commit 76bcf64

Browse files
committed
Rollup merge of #32147 - steveklabnik:gh31950, r=bluss
Clarify that try_unwrap needs exactly one Fixes #31950
2 parents d6c4b53 + df550de commit 76bcf64

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/liballoc/arc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ impl<T> Arc<T> {
201201
Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } }
202202
}
203203

204-
/// Unwraps the contained value if the `Arc<T>` has only one strong reference.
205-
/// This will succeed even if there are outstanding weak references.
204+
/// Unwraps the contained value if the `Arc<T>` has exactly one strong reference.
206205
///
207206
/// Otherwise, an `Err` is returned with the same `Arc<T>`.
208207
///
208+
/// This will succeed even if there are outstanding weak references.
209+
///
209210
/// # Examples
210211
///
211212
/// ```

src/liballoc/rc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ impl<T> Rc<T> {
224224
}
225225
}
226226

227-
/// Unwraps the contained value if the `Rc<T>` has only one strong reference.
228-
/// This will succeed even if there are outstanding weak references.
227+
/// Unwraps the contained value if the `Rc<T>` has exactly one strong reference.
229228
///
230229
/// Otherwise, an `Err` is returned with the same `Rc<T>`.
231230
///
231+
/// This will succeed even if there are outstanding weak references.
232+
///
232233
/// # Examples
233234
///
234235
/// ```

0 commit comments

Comments
 (0)