Skip to content

Commit 885a001

Browse files
committed
const-stabilize NonNull::dangling and NonNull::cast
1 parent e305df1 commit 885a001

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/libcore/ptr.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,6 @@ impl<T: Sized> NonNull<T> {
29592959
/// some other means.
29602960
#[stable(feature = "nonnull", since = "1.25.0")]
29612961
#[inline]
2962-
#[rustc_const_unstable(feature = "const_ptr_nonnull")]
29632962
pub const fn dangling() -> Self {
29642963
unsafe {
29652964
let ptr = mem::align_of::<T>() as *mut T;
@@ -3023,7 +3022,6 @@ impl<T: ?Sized> NonNull<T> {
30233022
/// Cast to a pointer of another type
30243023
#[stable(feature = "nonnull_cast", since = "1.27.0")]
30253024
#[inline]
3026-
#[rustc_const_unstable(feature = "const_ptr_nonnull")]
30273025
pub const fn cast<U>(self) -> NonNull<U> {
30283026
unsafe {
30293027
NonNull::new_unchecked(self.as_ptr() as *mut U)

src/test/run-pass/consts/const-ptr-nonnull.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(const_ptr_nonnull)]
4-
53
use std::ptr::NonNull;
64

75
const DANGLING: NonNull<u32> = NonNull::dangling();

0 commit comments

Comments
 (0)