Skip to content

Commit cb835c8

Browse files
authored
Rollup merge of rust-lang#88353 - jhpratt:stabilize-array-as-ref, r=joshtriplett
Partially stabilize `array_methods` This stabilizes `<[T; N]>::as_slice` and `<[T; N]>::as_mut_slice`, which is forms part of the `array_methods` feature: rust-lang#76118. This also makes `<[T; N]>::as_slice` const due to its trivial nature.
2 parents 7fc48c7 + 905c2ba commit cb835c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/array/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ impl<T, const N: usize> [T; N] {
368368
}
369369

370370
/// Returns a slice containing the entire array. Equivalent to `&s[..]`.
371-
#[unstable(feature = "array_methods", issue = "76118")]
372-
pub fn as_slice(&self) -> &[T] {
371+
#[stable(feature = "array_as_slice", since = "1.57.0")]
372+
pub const fn as_slice(&self) -> &[T] {
373373
self
374374
}
375375

376376
/// Returns a mutable slice containing the entire array. Equivalent to
377377
/// `&mut s[..]`.
378-
#[unstable(feature = "array_methods", issue = "76118")]
378+
#[stable(feature = "array_as_slice", since = "1.57.0")]
379379
pub fn as_mut_slice(&mut self) -> &mut [T] {
380380
self
381381
}

0 commit comments

Comments
 (0)