diff options
| author | bors <bors@rust-lang.org> | 2019-09-14 20:16:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-14 20:16:54 +0000 |
| commit | b35ebac96102cd12406d9d87827b0838d129c278 (patch) | |
| tree | 25bd19d9b15231761c8a84a2b61713d3d182a808 /src/liballoc | |
| parent | ca3766e2e58f462a20922e42c821a37eaf0e13db (diff) | |
| parent | 45e50e2fd28f1e2f93661e0dcefe5203ebb51c74 (diff) | |
| download | rust-b35ebac96102cd12406d9d87827b0838d129c278.tar.gz rust-b35ebac96102cd12406d9d87827b0838d129c278.zip | |
Auto merge of #64466 - Centril:rollup-s3nlb9e, r=Centril
Rollup of 4 pull requests Successful merges: - #61797 (Stabilise weak_ptr_eq) - #64290 (Provide a span if main function is not present in crate) - #64406 (Ban non-extern rust intrinsics) - #64462 (feature_gate: Remove dead code from attribute checking) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 9 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 10 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 439f24e95ca..f234ac5ebe5 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1832,8 +1832,9 @@ 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 /// @@ -1843,7 +1844,6 @@ impl<T: ?Sized> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_ptr_eq)] /// use std::rc::Rc; /// /// let first_rc = Rc::new(5); @@ -1861,7 +1861,6 @@ impl<T: ?Sized> Weak<T> { /// Comparing `Weak::new`. /// /// ``` - /// #![feature(weak_ptr_eq)] /// use std::rc::{Rc, Weak}; /// /// let first = Weak::new(); @@ -1873,7 +1872,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() } 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() } |
