Skip to content

Commit 1200d3d

Browse files
authored
Rollup merge of #134927 - DaniPopes:const-as_flattened_mut, r=scottmcm
Make slice::as_flattened_mut unstably const Tracking issue: #95629 Unblocked by const_mut_refs being stabilized: #129195
2 parents a777f4a + 26f523e commit 1200d3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/slice/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4821,7 +4821,8 @@ 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-
pub fn as_flattened_mut(&mut self) -> &mut [T] {
4824+
#[rustc_const_unstable(feature = "const_slice_flatten", issue = "95629")]
4825+
pub const fn as_flattened_mut(&mut self) -> &mut [T] {
48254826
let len = if T::IS_ZST {
48264827
self.len().checked_mul(N).expect("slice len overflow")
48274828
} else {

0 commit comments

Comments
 (0)