diff options
Diffstat (limited to 'src/liballoc/sync.rs')
| -rw-r--r-- | src/liballoc/sync.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index cde412bee78..cb660b476c4 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -325,7 +325,7 @@ impl<T> Arc<T> { weak: atomic::AtomicUsize::new(1), data, }; - Self::from_inner(Box::into_raw_non_null(x)) + Self::from_inner(Box::leak(x).into()) } /// Constructs a new `Arc` with uninitialized contents. @@ -659,6 +659,7 @@ impl<T: ?Sized> Arc<T> { /// /// ``` /// #![feature(rc_into_raw_non_null)] + /// #![allow(deprecated)] /// /// use std::sync::Arc; /// @@ -668,6 +669,7 @@ impl<T: ?Sized> Arc<T> { /// assert_eq!(deref, "hello"); /// ``` #[unstable(feature = "rc_into_raw_non_null", issue = "47336")] + #[rustc_deprecated(since = "1.44.0", reason = "use `Arc::into_raw` instead")] #[inline] pub fn into_raw_non_null(this: Self) -> NonNull<T> { // safe because Arc guarantees its pointer is non-null |
