Skip to content

Commit f4aaae9

Browse files
committed
Remove Rc::would_wrap
[unstable, deprecated since 1.15.0]
1 parent df86cec commit f4aaae9

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

src/doc/unstable-book/src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@
185185
- [rand](library-features/rand.md)
186186
- [range_contains](library-features/range-contains.md)
187187
- [raw](library-features/raw.md)
188-
- [rc_would_unwrap](library-features/rc-would-unwrap.md)
189188
- [retain_hash_collection](library-features/retain-hash-collection.md)
190189
- [reverse_cmp_key](library-features/reverse-cmp-key.md)
191190
- [rt](library-features/rt.md)

src/doc/unstable-book/src/library-features/rc-would-unwrap.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/liballoc/rc.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -341,19 +341,6 @@ impl<T> Rc<T> {
341341
}
342342
}
343343

344-
/// Checks whether [`Rc::try_unwrap`][try_unwrap] would return
345-
/// [`Ok`].
346-
///
347-
/// [try_unwrap]: struct.Rc.html#method.try_unwrap
348-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
349-
#[unstable(feature = "rc_would_unwrap",
350-
reason = "just added for niche usecase",
351-
issue = "28356")]
352-
#[rustc_deprecated(since = "1.15.0", reason = "too niche; use `strong_count` instead")]
353-
pub fn would_unwrap(this: &Self) -> bool {
354-
Rc::strong_count(&this) == 1
355-
}
356-
357344
/// Consumes the `Rc`, returning the wrapped pointer.
358345
///
359346
/// To avoid a memory leak the pointer must be converted back to an `Rc` using

0 commit comments

Comments
 (0)