From 740b0529fb23a69855447a9916bbb41d34918460 Mon Sep 17 00:00:00 2001 From: Waffle Date: Sun, 11 Apr 2021 22:06:32 +0300 Subject: [PATCH] stabilize core::array::{from_ref,from_mut} --- library/core/src/array/mod.rs | 4 ++-- library/core/tests/lib.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 8f52985d1df71..b20bed78789b1 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -23,14 +23,14 @@ mod iter; pub use iter::IntoIter; /// Converts a reference to `T` into a reference to an array of length 1 (without copying). -#[unstable(feature = "array_from_ref", issue = "77101")] +#[stable(feature = "array_from_ref", since = "1.53.0")] pub fn from_ref(s: &T) -> &[T; 1] { // SAFETY: Converting `&T` to `&[T; 1]` is sound. unsafe { &*(s as *const T).cast::<[T; 1]>() } } /// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying). -#[unstable(feature = "array_from_ref", issue = "77101")] +#[stable(feature = "array_from_ref", since = "1.53.0")] pub fn from_mut(s: &mut T) -> &mut [T; 1] { // SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound. unsafe { &mut *(s as *mut T).cast::<[T; 1]>() } diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index a96520680e309..113d35532bb84 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -1,6 +1,5 @@ #![feature(alloc_layout_extra)] #![feature(array_chunks)] -#![feature(array_from_ref)] #![feature(array_methods)] #![feature(array_map)] #![feature(array_windows)]