Skip to content

Commit 7e42feb

Browse files
DaniPopesgitbot
authored and
gitbot
committed
Make slice::as_flattened_mut unstably const
Tracking issue: rust-lang#95629 Unblocked by const_mut_refs being stabilized: rust-lang#129195
1 parent f595a73 commit 7e42feb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)