diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-14 22:16:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-14 22:16:03 +0200 |
| commit | dee08ba55accecc13ed600e0fb6559fb28e7f480 (patch) | |
| tree | 2344d7c63d885ba7907b6e02f2e2370e9ee702da /src/liballoc/sync.rs | |
| parent | ca3766e2e58f462a20922e42c821a37eaf0e13db (diff) | |
| parent | 307804a00d191b6f15d1a1a5b98fbae5ea6593b0 (diff) | |
| download | rust-dee08ba55accecc13ed600e0fb6559fb28e7f480.tar.gz rust-dee08ba55accecc13ed600e0fb6559fb28e7f480.zip | |
Rollup merge of #61797 - Thomasdezeeuw:stablise-weak_ptr_eq, r=RalfJung
Stabilise weak_ptr_eq Implemented in #55987. Closes #55981.
Diffstat (limited to 'src/liballoc/sync.rs')
| -rw-r--r-- | src/liballoc/sync.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 3bf22a87fea..45f98162e4c 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -1550,19 +1550,18 @@ impl<T: ?Sized> Weak<T> { } } - /// Returns `true` if the two `Weak`s point to the same value (not just values - /// that compare as equal). + /// Returns `true` if the two `Weak`s point to the same value (not just + /// values that compare as equal), or if both don't point to any value + /// (because they were created with `Weak::new()`). /// /// # Notes /// /// Since this compares pointers it means that `Weak::new()` will equal each /// other, even though they don't point to any value. /// - /// /// # Examples /// /// ``` - /// #![feature(weak_ptr_eq)] /// use std::sync::Arc; /// /// let first_rc = Arc::new(5); @@ -1580,7 +1579,6 @@ impl<T: ?Sized> Weak<T> { /// Comparing `Weak::new`. /// /// ``` - /// #![feature(weak_ptr_eq)] /// use std::sync::{Arc, Weak}; /// /// let first = Weak::new(); @@ -1592,7 +1590,7 @@ impl<T: ?Sized> Weak<T> { /// assert!(!first.ptr_eq(&third)); /// ``` #[inline] - #[unstable(feature = "weak_ptr_eq", issue = "55981")] + #[stable(feature = "weak_ptr_eq", since = "1.39.0")] pub fn ptr_eq(&self, other: &Self) -> bool { self.ptr.as_ptr() == other.ptr.as_ptr() } |
