Skip to content

Commit b359fe1

Browse files
committed
Deprecate Rc::into_raw_non_null and Arc::into_raw_non_null
1 parent cdb6bef commit b359fe1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/liballoc/rc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ impl<T: ?Sized> Rc<T> {
636636
///
637637
/// ```
638638
/// #![feature(rc_into_raw_non_null)]
639+
/// #![allow(deprecated)]
639640
///
640641
/// use std::rc::Rc;
641642
///
@@ -645,6 +646,7 @@ impl<T: ?Sized> Rc<T> {
645646
/// assert_eq!(deref, "hello");
646647
/// ```
647648
#[unstable(feature = "rc_into_raw_non_null", issue = "47336")]
649+
#[rustc_deprecated(since = "1.44.0", reason = "use `Rc::into_raw` instead")]
648650
#[inline]
649651
pub fn into_raw_non_null(this: Self) -> NonNull<T> {
650652
// safe because Rc guarantees its pointer is non-null

src/liballoc/sync.rs

+2
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ impl<T: ?Sized> Arc<T> {
635635
///
636636
/// ```
637637
/// #![feature(rc_into_raw_non_null)]
638+
/// #![allow(deprecated)]
638639
///
639640
/// use std::sync::Arc;
640641
///
@@ -644,6 +645,7 @@ impl<T: ?Sized> Arc<T> {
644645
/// assert_eq!(deref, "hello");
645646
/// ```
646647
#[unstable(feature = "rc_into_raw_non_null", issue = "47336")]
648+
#[rustc_deprecated(since = "1.44.0", reason = "use `Rc::into_raw` instead")]
647649
#[inline]
648650
pub fn into_raw_non_null(this: Self) -> NonNull<T> {
649651
// safe because Arc guarantees its pointer is non-null

0 commit comments

Comments
 (0)