From 885a001788d18dbbde14587e1dbccca0dad73776 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 24 Apr 2019 21:15:25 +0200 Subject: [PATCH] const-stabilize NonNull::dangling and NonNull::cast --- src/libcore/ptr.rs | 2 -- src/test/run-pass/consts/const-ptr-nonnull.rs | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index f05700a1db285..eee83ba5ebd3b 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2959,7 +2959,6 @@ impl NonNull { /// some other means. #[stable(feature = "nonnull", since = "1.25.0")] #[inline] - #[rustc_const_unstable(feature = "const_ptr_nonnull")] pub const fn dangling() -> Self { unsafe { let ptr = mem::align_of::() as *mut T; @@ -3023,7 +3022,6 @@ impl NonNull { /// Cast to a pointer of another type #[stable(feature = "nonnull_cast", since = "1.27.0")] #[inline] - #[rustc_const_unstable(feature = "const_ptr_nonnull")] pub const fn cast(self) -> NonNull { unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) diff --git a/src/test/run-pass/consts/const-ptr-nonnull.rs b/src/test/run-pass/consts/const-ptr-nonnull.rs index 91624e92fbe75..c5b9d837b47a8 100644 --- a/src/test/run-pass/consts/const-ptr-nonnull.rs +++ b/src/test/run-pass/consts/const-ptr-nonnull.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(const_ptr_nonnull)] - use std::ptr::NonNull; const DANGLING: NonNull = NonNull::dangling();