Skip to content

Commit 740b052

Browse files
committed
stabilize core::array::{from_ref,from_mut}
1 parent 010c236 commit 740b052

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

library/core/src/array/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ mod iter;
2323
pub use iter::IntoIter;
2424

2525
/// Converts a reference to `T` into a reference to an array of length 1 (without copying).
26-
#[unstable(feature = "array_from_ref", issue = "77101")]
26+
#[stable(feature = "array_from_ref", since = "1.53.0")]
2727
pub fn from_ref<T>(s: &T) -> &[T; 1] {
2828
// SAFETY: Converting `&T` to `&[T; 1]` is sound.
2929
unsafe { &*(s as *const T).cast::<[T; 1]>() }
3030
}
3131

3232
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
33-
#[unstable(feature = "array_from_ref", issue = "77101")]
33+
#[stable(feature = "array_from_ref", since = "1.53.0")]
3434
pub fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
3535
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
3636
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(alloc_layout_extra)]
22
#![feature(array_chunks)]
3-
#![feature(array_from_ref)]
43
#![feature(array_methods)]
54
#![feature(array_map)]
65
#![feature(array_windows)]

0 commit comments

Comments
 (0)