diff options
| author | Josh Stone <jistone@redhat.com> | 2017-04-20 14:02:20 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-04-20 21:16:31 -0700 |
| commit | f0c5e8b8fc6d3631de39cfc250868da993ff4086 (patch) | |
| tree | 69df993022fdeda96172556df10f9c549eee40c3 | |
| parent | f4aaae9bdbca695d8d60feaa63cb09cf06598d50 (diff) | |
| download | rust-f0c5e8b8fc6d3631de39cfc250868da993ff4086.tar.gz rust-f0c5e8b8fc6d3631de39cfc250868da993ff4086.zip | |
Privatize Rc::is_unique
[unstable, deprecated since 1.15.0]
| -rw-r--r-- | src/doc/unstable-book/src/SUMMARY.md | 1 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/library-features/is-unique.md | 7 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 6 |
3 files changed, 1 insertions, 13 deletions
diff --git a/src/doc/unstable-book/src/SUMMARY.md b/src/doc/unstable-book/src/SUMMARY.md index cc03ac4d244..0362ed6ba9d 100644 --- a/src/doc/unstable-book/src/SUMMARY.md +++ b/src/doc/unstable-book/src/SUMMARY.md @@ -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) diff --git a/src/doc/unstable-book/src/library-features/is-unique.md b/src/doc/unstable-book/src/library-features/is-unique.md deleted file mode 100644 index 6070006758b..00000000000 --- a/src/doc/unstable-book/src/library-features/is-unique.md +++ /dev/null @@ -1,7 +0,0 @@ -# `is_unique` - -The tracking issue for this feature is: [#28356] - -[#28356]: https://github.com/rust-lang/rust/issues/28356 - ------------------------- diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index dab6cf011bd..b12d89867c8 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -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 } |
