Skip to content

Commit 7de250f

Browse files
committed
Stabilize const_slice_flatten
Const-stabilizes `slice::as_flattened{,_mut}`: ```rust // core::slice impl<T, const N: usize> [[T; N]] { pub const fn as_flattened(&self) -> &[T]; pub const fn as_flattened_mut(&mut self) -> &mut [T]; } ``` Tracking issue: #95629 Requires separate libs-api FCP, as per #95629 (comment). Closes #95629.
1 parent eeeff9a commit 7de250f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: library/core/src/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4784,7 +4784,7 @@ impl<T, const N: usize> [[T; N]] {
47844784
/// assert!(empty_slice_of_arrays.as_flattened().is_empty());
47854785
/// ```
47864786
#[stable(feature = "slice_flatten", since = "1.80.0")]
4787-
#[rustc_const_unstable(feature = "const_slice_flatten", issue = "95629")]
4787+
#[rustc_const_stable(feature = "const_slice_flatten", since = "CURRENT_RUSTC_VERSION")]
47884788
pub const fn as_flattened(&self) -> &[T] {
47894789
let len = if T::IS_ZST {
47904790
self.len().checked_mul(N).expect("slice len overflow")
@@ -4821,7 +4821,7 @@ impl<T, const N: usize> [[T; N]] {
48214821
/// assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
48224822
/// ```
48234823
#[stable(feature = "slice_flatten", since = "1.80.0")]
4824-
#[rustc_const_unstable(feature = "const_slice_flatten", issue = "95629")]
4824+
#[rustc_const_stable(feature = "const_slice_flatten", since = "CURRENT_RUSTC_VERSION")]
48254825
pub const fn as_flattened_mut(&mut self) -> &mut [T] {
48264826
let len = if T::IS_ZST {
48274827
self.len().checked_mul(N).expect("slice len overflow")

0 commit comments

Comments
 (0)