]> git.lizzy.rs Git - rust.git/commitdiff
Deprecate `Rc::into_raw_non_null` and `Arc::into_raw_non_null`
authorSimon Sapin <simon.sapin@exyr.org>
Wed, 15 Apr 2020 13:56:07 +0000 (15:56 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Wed, 15 Apr 2020 14:18:33 +0000 (16:18 +0200)
src/liballoc/rc.rs
src/liballoc/sync.rs

index 653b4573e2a45e328125134697e48785588704b0..602f3b803f5fef9249f5af7644d8de9ea3298030 100644 (file)
@@ -636,6 +636,7 @@ pub unsafe fn from_raw(ptr: *const T) -> Self {
     ///
     /// ```
     /// #![feature(rc_into_raw_non_null)]
+    /// #![allow(deprecated)]
     ///
     /// use std::rc::Rc;
     ///
@@ -645,6 +646,7 @@ pub unsafe fn from_raw(ptr: *const T) -> Self {
     /// assert_eq!(deref, "hello");
     /// ```
     #[unstable(feature = "rc_into_raw_non_null", issue = "47336")]
+    #[rustc_deprecated(since = "1.44.0", reason = "use `Rc::into_raw` instead")]
     #[inline]
     pub fn into_raw_non_null(this: Self) -> NonNull<T> {
         // safe because Rc guarantees its pointer is non-null
index 59bc8686cf4f9ac98b0f4858cc22ba7eb1666d7e..34372b18254acd37e8a448ad3d4950af16c044b5 100644 (file)
@@ -635,6 +635,7 @@ pub unsafe fn from_raw(ptr: *const T) -> Self {
     ///
     /// ```
     /// #![feature(rc_into_raw_non_null)]
+    /// #![allow(deprecated)]
     ///
     /// use std::sync::Arc;
     ///
@@ -644,6 +645,7 @@ pub unsafe fn from_raw(ptr: *const T) -> Self {
     /// assert_eq!(deref, "hello");
     /// ```
     #[unstable(feature = "rc_into_raw_non_null", issue = "47336")]
+    #[rustc_deprecated(since = "1.44.0", reason = "use `Rc::into_raw` instead")]
     #[inline]
     pub fn into_raw_non_null(this: Self) -> NonNull<T> {
         // safe because Arc guarantees its pointer is non-null