Skip to content

Commit cd6c1cc

Browse files
library: Stabilize const_ptr_as_ref
Const-stabilizes: - `NonNull::as_mut`
1 parent ecb0f03 commit cd6c1cc

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
#![feature(const_option_ext)]
141141
#![feature(const_pin)]
142142
#![feature(const_pointer_is_aligned)]
143-
#![feature(const_ptr_as_ref)]
144143
#![feature(const_ptr_is_null)]
145144
#![feature(const_ptr_sub_ptr)]
146145
#![feature(const_ptr_write)]

core/src/ptr/non_null.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ impl<T: ?Sized> NonNull<T> {
394394
///
395395
/// [the module documentation]: crate::ptr#safety
396396
#[stable(feature = "nonnull", since = "1.25.0")]
397-
#[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
397+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
398+
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "CURRENT_RUSTC_VERSION")]
398399
#[must_use]
399400
#[inline(always)]
400401
pub const unsafe fn as_mut<'a>(&mut self) -> &'a mut T {

core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#![feature(const_option_ext)]
3131
#![feature(const_pin)]
3232
#![feature(const_pointer_is_aligned)]
33-
#![feature(const_ptr_as_ref)]
3433
#![feature(const_ptr_write)]
3534
#![feature(const_result)]
3635
#![feature(const_slice_from_ref)]

0 commit comments

Comments
 (0)