Skip to content

Commit

Permalink
Privatize Rc::is_unique
Browse files Browse the repository at this point in the history
[unstable, deprecated since 1.15.0]
  • Loading branch information
cuviper committed Apr 21, 2017
1 parent f4aaae9 commit f0c5e8b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion src/doc/unstable-book/src/SUMMARY.md
Expand Up @@ -155,7 +155,6 @@
- [io_error_internals](library-features/io-error-internals.md)
- [io](library-features/io.md)
- [ip](library-features/ip.md)
- [is_unique](library-features/is-unique.md)
- [iter_rfind](library-features/iter-rfind.md)
- [libstd_io_internals](library-features/libstd-io-internals.md)
- [libstd_sys_internals](library-features/libstd-sys-internals.md)
Expand Down
7 changes: 0 additions & 7 deletions src/doc/unstable-book/src/library-features/is-unique.md

This file was deleted.

6 changes: 1 addition & 5 deletions src/liballoc/rc.rs
Expand Up @@ -488,11 +488,7 @@ impl<T: ?Sized> Rc<T> {
///
/// [weak]: struct.Weak.html
#[inline]
#[unstable(feature = "is_unique", reason = "uniqueness has unclear meaning",
issue = "28356")]
#[rustc_deprecated(since = "1.15.0",
reason = "too niche; use `strong_count` and `weak_count` instead")]
pub fn is_unique(this: &Self) -> bool {
fn is_unique(this: &Self) -> bool {
Rc::weak_count(this) == 0 && Rc::strong_count(this) == 1
}

Expand Down

0 comments on commit f0c5e8b

Please sign in to comment.