Rollup merge of #32147 - steveklabnik:gh31950, r=bluss
Clarify that try_unwrap needs exactly one Fixes #31950
This commit is contained in:
commit
76bcf6430f
2 changed files with 6 additions and 4 deletions
|
@ -201,11 +201,12 @@ impl<T> Arc<T> {
|
||||||
Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } }
|
Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unwraps the contained value if the `Arc<T>` has only one strong reference.
|
/// Unwraps the contained value if the `Arc<T>` has exactly one strong reference.
|
||||||
/// This will succeed even if there are outstanding weak references.
|
|
||||||
///
|
///
|
||||||
/// Otherwise, an `Err` is returned with the same `Arc<T>`.
|
/// Otherwise, an `Err` is returned with the same `Arc<T>`.
|
||||||
///
|
///
|
||||||
|
/// This will succeed even if there are outstanding weak references.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
@ -224,11 +224,12 @@ impl<T> Rc<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unwraps the contained value if the `Rc<T>` has only one strong reference.
|
/// Unwraps the contained value if the `Rc<T>` has exactly one strong reference.
|
||||||
/// This will succeed even if there are outstanding weak references.
|
|
||||||
///
|
///
|
||||||
/// Otherwise, an `Err` is returned with the same `Rc<T>`.
|
/// Otherwise, an `Err` is returned with the same `Rc<T>`.
|
||||||
///
|
///
|
||||||
|
/// This will succeed even if there are outstanding weak references.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue