Skip to content

Commit 6cddada

Browse files
fmeasegitbot
authored and
gitbot
committed
Rollup merge of rust-lang#134116 - RalfJung:const_nonnull_new, r=jhpratt
stabilize const_nonnull_new FCP passed in rust-lang#93235 Closes rust-lang#93235
2 parents 77686a2 + d24247e commit 6cddada

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

core/src/ptr/non_null.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<T: ?Sized> NonNull<T> {
217217
/// }
218218
/// ```
219219
#[stable(feature = "nonnull", since = "1.25.0")]
220-
#[rustc_const_unstable(feature = "const_nonnull_new", issue = "93235")]
220+
#[rustc_const_stable(feature = "const_nonnull_new", since = "CURRENT_RUSTC_VERSION")]
221221
#[inline]
222222
pub const fn new(ptr: *mut T) -> Option<Self> {
223223
if !ptr.is_null() {

core/src/ptr/unique.rs

-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ impl<T: ?Sized> Unique<T> {
9292

9393
/// Creates a new `Unique` if `ptr` is non-null.
9494
#[inline]
95-
// rustc_const_unstable attribute can be removed when `const_nonnull_new` is stable
96-
#[rustc_const_unstable(feature = "ptr_internals", issue = "none")]
9795
pub const fn new(ptr: *mut T) -> Option<Self> {
9896
if let Some(pointer) = NonNull::new(ptr) {
9997
Some(Unique { pointer, _marker: PhantomData })

core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(clone_to_uninit)]
1616
#![feature(const_black_box)]
1717
#![feature(const_eval_select)]
18-
#![feature(const_nonnull_new)]
1918
#![feature(const_swap)]
2019
#![feature(const_trait_impl)]
2120
#![feature(core_intrinsics)]

0 commit comments

Comments
 (0)