diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-11-23 20:19:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-23 20:19:54 +0800 |
| commit | 8036ff1302245cad6a2501e84d337019a184b1a0 (patch) | |
| tree | f1fcdf83869252f50cc6f97b04e87a44c00f2049 | |
| parent | 4d9cd661c73fd57c58751ae2909adde64f9bdedb (diff) | |
| parent | c85a742cb12491b1f138c5d208f9c0cc5434dd77 (diff) | |
| download | rust-8036ff1302245cad6a2501e84d337019a184b1a0.tar.gz rust-8036ff1302245cad6a2501e84d337019a184b1a0.zip | |
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.
| -rw-r--r-- | library/core/src/array/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 71dcab3423c..67fbda34bb9 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -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 } |
