From 7a09b8a7b52e5f9e9f7145657629bca9d89f16f0 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 24 May 2022 22:33:31 +0400 Subject: [PATCH] Stabilize `{slice,array}::from_ref` --- library/core/src/array/mod.rs | 2 +- library/core/src/slice/raw.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index fba1a5a751c59..2ea4458bf6427 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -92,7 +92,7 @@ where /// Converts a reference to `T` into a reference to an array of length 1 (without copying). #[stable(feature = "array_from_ref", since = "1.53.0")] -#[rustc_const_unstable(feature = "const_array_from_ref", issue = "90206")] +#[rustc_const_stable(feature = "const_array_from_ref_shared", since = "1.63.0")] pub const fn from_ref(s: &T) -> &[T; 1] { // SAFETY: Converting `&T` to `&[T; 1]` is sound. unsafe { &*(s as *const T).cast::<[T; 1]>() } diff --git a/library/core/src/slice/raw.rs b/library/core/src/slice/raw.rs index 6bc60b04b5c64..76dc3351d344c 100644 --- a/library/core/src/slice/raw.rs +++ b/library/core/src/slice/raw.rs @@ -144,7 +144,7 @@ pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a m /// Converts a reference to T into a slice of length 1 (without copying). #[stable(feature = "from_ref", since = "1.28.0")] -#[rustc_const_unstable(feature = "const_slice_from_ref", issue = "90206")] +#[rustc_const_stable(feature = "const_slice_from_ref_shared", since = "1.63.0")] #[must_use] pub const fn from_ref(s: &T) -> &[T] { array::from_ref(s)