Rollup merge of #140066 - thaliaarchi:const-array-as-mut-slice, r=jhpratt

Stabilize `<[T; N]>::as_mut_slice` as `const`

This is trivial and has no design questions.

Tracked in https://github.com/rust-lang/rust/issues/133333.

r? libs-api
This commit is contained in:
Guillaume Gomez 2025-05-24 21:23:47 +02:00 committed by GitHub
commit 07157b78b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -588,7 +588,7 @@ impl<T, const N: usize> [T; N] {
/// Returns a mutable slice containing the entire array. Equivalent to
/// `&mut s[..]`.
#[stable(feature = "array_as_slice", since = "1.57.0")]
#[rustc_const_unstable(feature = "const_array_as_mut_slice", issue = "133333")]
#[rustc_const_stable(feature = "const_array_as_mut_slice", since = "CURRENT_RUSTC_VERSION")]
pub const fn as_mut_slice(&mut self) -> &mut [T] {
self
}