mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-07 13:25:45 +00:00
Rollup merge of #133332 - bjoernager:const-array-as-mut-slice, r=jhpratt
Mark `<[T; N]>::as_mut_slice` with the `const` specifier. Tracking issue: #133333 `<[T; N]>::as_mut_slice` can have the `const` specifier without any changes to the function body.
This commit is contained in:
commit
8036ff1302
@ -579,7 +579,8 @@ 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")]
|
||||
pub fn as_mut_slice(&mut self) -> &mut [T] {
|
||||
#[rustc_const_unstable(feature = "const_array_as_mut_slice", issue = "133333")]
|
||||
pub const fn as_mut_slice(&mut self) -> &mut [T] {
|
||||
self
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user