Deprecate `Rc::into_raw_non_null` and `Arc::into_raw_non_null`

This commit is contained in:
Simon Sapin 2020-04-15 15:56:07 +02:00
parent cdb6bef4fb
commit b359fe1eea
2 changed files with 4 additions and 0 deletions

View File

@ -636,6 +636,7 @@ impl<T: ?Sized> Rc<T> {
///
/// ```
/// #![feature(rc_into_raw_non_null)]
/// #![allow(deprecated)]
///
/// use std::rc::Rc;
///
@ -645,6 +646,7 @@ impl<T: ?Sized> Rc<T> {
/// 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

View File

@ -635,6 +635,7 @@ impl<T: ?Sized> Arc<T> {
///
/// ```
/// #![feature(rc_into_raw_non_null)]
/// #![allow(deprecated)]
///
/// use std::sync::Arc;
///
@ -644,6 +645,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 `Rc::into_raw` instead")]
#[inline]
pub fn into_raw_non_null(this: Self) -> NonNull<T> {
// safe because Arc guarantees its pointer is non-null