Skip to content

Commit a193b7c

Browse files
WaffleLapkindtolnay
authored andcommitted
Stabilize ptr::{from_ref, from_mut}
1 parent 4301c24 commit a193b7c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/src/ptr/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,8 @@ where
720720
/// type or mutability, in particular if the code is refactored.
721721
#[inline(always)]
722722
#[must_use]
723-
#[unstable(feature = "ptr_from_ref", issue = "106116")]
723+
#[stable(feature = "ptr_from_ref", since = "CURRENT_RUSTC_VERSION")]
724+
#[rustc_const_stable(feature = "ptr_from_ref", since = "CURRENT_RUSTC_VERSION")]
724725
#[rustc_never_returns_null_ptr]
725726
#[rustc_diagnostic_item = "ptr_from_ref"]
726727
pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
@@ -733,7 +734,9 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
733734
/// type or mutability, in particular if the code is refactored.
734735
#[inline(always)]
735736
#[must_use]
736-
#[unstable(feature = "ptr_from_ref", issue = "106116")]
737+
#[stable(feature = "ptr_from_ref", since = "CURRENT_RUSTC_VERSION")]
738+
#[rustc_const_stable(feature = "ptr_from_ref", since = "CURRENT_RUSTC_VERSION")]
739+
#[rustc_allow_const_fn_unstable(const_mut_refs)]
737740
#[rustc_never_returns_null_ptr]
738741
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
739742
r

std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@
338338
#![feature(portable_simd)]
339339
#![feature(prelude_2024)]
340340
#![feature(ptr_as_uninit)]
341-
#![feature(ptr_from_ref)]
342341
#![feature(raw_os_nonzero)]
343342
#![feature(round_ties_even)]
344343
#![feature(slice_internals)]

0 commit comments

Comments
 (0)