Remove Rc::would_wrap

[unstable, deprecated since 1.15.0]
This commit is contained in:
Josh Stone
2017-04-20 13:55:38 -07:00
parent df86cecdd2
commit f4aaae9bdb
3 changed files with 0 additions and 19 deletions

View File

@@ -341,19 +341,6 @@ impl<T> Rc<T> {
}
}
/// Checks whether [`Rc::try_unwrap`][try_unwrap] would return
/// [`Ok`].
///
/// [try_unwrap]: struct.Rc.html#method.try_unwrap
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
#[unstable(feature = "rc_would_unwrap",
reason = "just added for niche usecase",
issue = "28356")]
#[rustc_deprecated(since = "1.15.0", reason = "too niche; use `strong_count` instead")]
pub fn would_unwrap(this: &Self) -> bool {
Rc::strong_count(&this) == 1
}
/// Consumes the `Rc`, returning the wrapped pointer.
///
/// To avoid a memory leak the pointer must be converted back to an `Rc` using