diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-03 23:13:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-03 23:13:19 -0700 |
| commit | 70d82e0a6ebc5166ba6745743a0aceac5df1da7e (patch) | |
| tree | 43acad04793b580d0b917b716157be98fe0a2d68 /library/core/src/array | |
| parent | e4d257e1d359cb0ec25f7a38964eef8a19d7ae71 (diff) | |
| parent | 905c2ba5f8592c9722c7317cbc2781a7561c250b (diff) | |
| download | rust-70d82e0a6ebc5166ba6745743a0aceac5df1da7e.tar.gz rust-70d82e0a6ebc5166ba6745743a0aceac5df1da7e.zip | |
Rollup merge of #88353 - jhpratt:stabilize-array-as-ref, r=joshtriplett
Partially stabilize `array_methods` This stabilizes `<[T; N]>::as_slice` and `<[T; N]>::as_mut_slice`, which is forms part of the `array_methods` feature: #76118. 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 8c33a43ab33..09329247f94 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 } |
