diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-05-29 15:06:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 15:06:55 +0900 |
| commit | d472f8e4624277163f33f9070bf0474669d3844e (patch) | |
| tree | a5125d43d54a6a6bc8a0a2a57414e730cbb5653c /src/liballoc | |
| parent | ea5848df4b6150a5d308af643968d54bb510ac03 (diff) | |
| parent | ba0d0c27df15b7a4d15d01eef3043ffb6cf65a8e (diff) | |
Rollup merge of #72288 - vorner:stabilize-weak-into-raw, r=dtolnay
Stabilization of weak-into-raw Closes #60728. There are also two removals of `#![feature(weak_into_raw)]` in the `src/tools/miri` submodule. How should I synchronize the changes with there? * I can ignore it for now and once this gets merged, update the tool, send a pull request to that one and then reference the changes to rustc. * I could try submitting the changes to miri first, but then the build would fail there, because the attribute would still be needed. I think the first one is the correct one, extrapolating from the contributing guidelines (even though they speak about breaking the tools and this should not break it, as extra feature should not hurt).
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 16 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index ad96a138d7e..4edbc2ff3ac 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -580,8 +580,6 @@ impl<T: ?Sized> Rc<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::rc::Rc; /// /// let x = Rc::new("hello".to_owned()); @@ -590,7 +588,7 @@ impl<T: ?Sized> Rc<T> { /// assert_eq!(x_ptr, Rc::as_ptr(&y)); /// assert_eq!(unsafe { &*x_ptr }, "hello"); /// ``` - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn as_ptr(this: &Self) -> *const T { let ptr: *mut RcBox<T> = NonNull::as_ptr(this.ptr); let fake_ptr = ptr as *mut T; @@ -1681,8 +1679,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::rc::Rc; /// use std::ptr; /// @@ -1700,7 +1696,7 @@ impl<T> Weak<T> { /// ``` /// /// [`null`]: ../../std/ptr/fn.null.html - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn as_ptr(&self) -> *const T { let offset = data_offset_sized::<T>(); let ptr = self.ptr.cast::<u8>().as_ptr().wrapping_offset(offset); @@ -1718,8 +1714,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::rc::{Rc, Weak}; /// /// let strong = Rc::new("hello".to_owned()); @@ -1735,7 +1729,7 @@ impl<T> Weak<T> { /// /// [`from_raw`]: struct.Weak.html#method.from_raw /// [`as_ptr`]: struct.Weak.html#method.as_ptr - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn into_raw(self) -> *const T { let result = self.as_ptr(); mem::forget(self); @@ -1762,8 +1756,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::rc::{Rc, Weak}; /// /// let strong = Rc::new("hello".to_owned()); @@ -1788,7 +1780,7 @@ impl<T> Weak<T> { /// [`Weak`]: struct.Weak.html /// [`new`]: struct.Weak.html#method.new /// [`forget`]: ../../std/mem/fn.forget.html - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub unsafe fn from_raw(ptr: *const T) -> Self { if ptr.is_null() { Self::new() diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 8a45715e89c..5de3cac9d53 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -579,8 +579,6 @@ impl<T: ?Sized> Arc<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::sync::Arc; /// /// let x = Arc::new("hello".to_owned()); @@ -589,7 +587,7 @@ impl<T: ?Sized> Arc<T> { /// assert_eq!(x_ptr, Arc::as_ptr(&y)); /// assert_eq!(unsafe { &*x_ptr }, "hello"); /// ``` - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn as_ptr(this: &Self) -> *const T { let ptr: *mut ArcInner<T> = NonNull::as_ptr(this.ptr); let fake_ptr = ptr as *mut T; @@ -1449,8 +1447,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::sync::Arc; /// use std::ptr; /// @@ -1468,7 +1464,7 @@ impl<T> Weak<T> { /// ``` /// /// [`null`]: ../../std/ptr/fn.null.html - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn as_ptr(&self) -> *const T { let offset = data_offset_sized::<T>(); let ptr = self.ptr.cast::<u8>().as_ptr().wrapping_offset(offset); @@ -1486,8 +1482,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::sync::{Arc, Weak}; /// /// let strong = Arc::new("hello".to_owned()); @@ -1503,7 +1497,7 @@ impl<T> Weak<T> { /// /// [`from_raw`]: struct.Weak.html#method.from_raw /// [`as_ptr`]: struct.Weak.html#method.as_ptr - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub fn into_raw(self) -> *const T { let result = self.as_ptr(); mem::forget(self); @@ -1531,8 +1525,6 @@ impl<T> Weak<T> { /// # Examples /// /// ``` - /// #![feature(weak_into_raw)] - /// /// use std::sync::{Arc, Weak}; /// /// let strong = Arc::new("hello".to_owned()); @@ -1557,7 +1549,7 @@ impl<T> Weak<T> { /// [`Weak`]: struct.Weak.html /// [`Arc`]: struct.Arc.html /// [`forget`]: ../../std/mem/fn.forget.html - #[unstable(feature = "weak_into_raw", issue = "60728")] + #[stable(feature = "weak_into_raw", since = "1.45.0")] pub unsafe fn from_raw(ptr: *const T) -> Self { if ptr.is_null() { Self::new() |
