From c85a742cb12491b1f138c5d208f9c0cc5434dd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Bj=C3=B8rnager=20Jensen?= Date: Fri, 22 Nov 2024 09:44:08 +0100 Subject: [PATCH] Mark '<[T; N]>::as_mut_slice' as 'const'; --- library/core/src/array/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 4764d7f0b0fe0..a9d6a1d6a5daa 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -577,7 +577,8 @@ impl [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 }