mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Extended the documentation for Arc's Weak::upgrade
This commit is contained in:
@@ -3501,7 +3501,13 @@ pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Self {
|
||||
/// Attempts to upgrade the `Weak` pointer to an [`Rc`], delaying
|
||||
/// dropping of the inner value if successful.
|
||||
///
|
||||
/// Returns [`None`] if the inner value has since been dropped.
|
||||
/// Returns [`None`] in the following cases:
|
||||
///
|
||||
/// 1. The inner value has since been dropped or moved out.
|
||||
///
|
||||
/// 2. This `Weak` does not point to an allocation.
|
||||
///
|
||||
/// 3. The owning reference this `Weak` is associated with is either not fully-constructed or does not allow an upgrade.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
@@ -3232,7 +3232,13 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
|
||||
/// Attempts to upgrade the `Weak` pointer to an [`Arc`], delaying
|
||||
/// dropping of the inner value if successful.
|
||||
///
|
||||
/// Returns [`None`] if the inner value has since been dropped.
|
||||
/// Returns [`None`] in the following cases:
|
||||
///
|
||||
/// 1. The inner value has since been dropped or moved out.
|
||||
///
|
||||
/// 2. This `Weak` does not point to an allocation.
|
||||
///
|
||||
/// 3. The owning reference this `Weak` is associated with is either not fully-constructed or does not allow an upgrade.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user