Skip to content

Commit 7a09b8a

Browse files
committed
Stabilize {slice,array}::from_ref
1 parent b2eba05 commit 7a09b8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/array/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ where
9292

9393
/// Converts a reference to `T` into a reference to an array of length 1 (without copying).
9494
#[stable(feature = "array_from_ref", since = "1.53.0")]
95-
#[rustc_const_unstable(feature = "const_array_from_ref", issue = "90206")]
95+
#[rustc_const_stable(feature = "const_array_from_ref_shared", since = "1.63.0")]
9696
pub const fn from_ref<T>(s: &T) -> &[T; 1] {
9797
// SAFETY: Converting `&T` to `&[T; 1]` is sound.
9898
unsafe { &*(s as *const T).cast::<[T; 1]>() }

library/core/src/slice/raw.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a m
144144

145145
/// Converts a reference to T into a slice of length 1 (without copying).
146146
#[stable(feature = "from_ref", since = "1.28.0")]
147-
#[rustc_const_unstable(feature = "const_slice_from_ref", issue = "90206")]
147+
#[rustc_const_stable(feature = "const_slice_from_ref_shared", since = "1.63.0")]
148148
#[must_use]
149149
pub const fn from_ref<T>(s: &T) -> &[T] {
150150
array::from_ref(s)

0 commit comments

Comments
 (0)