diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2021-08-26 05:27:39 -0400 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2021-08-26 05:27:39 -0400 |
| commit | 905c2ba5f8592c9722c7317cbc2781a7561c250b (patch) | |
| tree | 2b84ac66e2096eff7f4a63f7a0bedf4896a3ecf3 /library/core/src/array | |
| parent | 76e755cf4afc34af586948e7bc25d2f1c589a884 (diff) | |
Partially stabilize `array_methods`
This also makes `<[T; N]>::as_slice` const due to its trivial nature.
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 3c638e655dc..3b21a980e8f 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -368,14 +368,14 @@ impl<T, const N: usize> [T; N] { } /// Returns a slice containing the entire array. Equivalent to `&s[..]`. - #[unstable(feature = "array_methods", issue = "76118")] - pub fn as_slice(&self) -> &[T] { + #[stable(feature = "array_as_slice", since = "1.57.0")] + pub const fn as_slice(&self) -> &[T] { self } /// Returns a mutable slice containing the entire array. Equivalent to /// `&mut s[..]`. - #[unstable(feature = "array_methods", issue = "76118")] + #[stable(feature = "array_as_slice", since = "1.57.0")] pub fn as_mut_slice(&mut self) -> &mut [T] { self } |
