Skip to content

Commit

Permalink
Unrolled build for rust-lang#133332
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#133332 - bjoernager:const-array-as-mut-slice, r=jhpratt

Mark `<[T; N]>::as_mut_slice` with the `const` specifier.

Tracking issue: rust-lang#133333

`<[T; N]>::as_mut_slice` can have the `const` specifier without any changes to the function body.
  • Loading branch information
rust-timer authored Nov 23, 2024
2 parents ff1737b + c85a742 commit f8f5560
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit f8f5560

Please sign in to comment.