]> git.lizzy.rs Git - rust.git/commitdiff
Remove Rc::would_wrap
authorJosh Stone <jistone@redhat.com>
Thu, 20 Apr 2017 20:55:38 +0000 (13:55 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 21 Apr 2017 04:16:31 +0000 (21:16 -0700)
[unstable, deprecated since 1.15.0]

src/doc/unstable-book/src/SUMMARY.md
src/doc/unstable-book/src/library-features/rc-would-unwrap.md [deleted file]
src/liballoc/rc.rs

index 0d5aa4b5c422c5d1d5322b326f238964d60a989f..cc03ac4d244dd700037b5f0fa832155ea0290fce 100644 (file)
     - [rand](library-features/rand.md)
     - [range_contains](library-features/range-contains.md)
     - [raw](library-features/raw.md)
-    - [rc_would_unwrap](library-features/rc-would-unwrap.md)
     - [retain_hash_collection](library-features/retain-hash-collection.md)
     - [reverse_cmp_key](library-features/reverse-cmp-key.md)
     - [rt](library-features/rt.md)
diff --git a/src/doc/unstable-book/src/library-features/rc-would-unwrap.md b/src/doc/unstable-book/src/library-features/rc-would-unwrap.md
deleted file mode 100644 (file)
index 462387d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# `rc_would_unwrap`
-
-The tracking issue for this feature is: [#28356]
-
-[#28356]: https://github.com/rust-lang/rust/issues/28356
index fed718e9be4c6aa6ec5eba5c7b184a23c34e47dc..dab6cf011bdf4188fc0f2b2f85dfe3456586dc12 100644 (file)
@@ -341,19 +341,6 @@ pub fn try_unwrap(this: Self) -> Result<T, Self> {
         }
     }
 
-    /// 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