Skip to content

Commit ec95a92

Browse files
authored
Rollup merge of rust-lang#101180 - SUPERCILEX:const-maybeuninit, r=TaKO8Ki
Add another MaybeUninit array test with const This is another possible syntax and I just want to be absolutely sure it behaves correctly.
2 parents c467370 + eaa0025 commit ec95a92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/codegen/issue-96274.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
// compile-flags: -O
33

44
#![crate_type = "lib"]
5+
#![feature(inline_const)]
56

67
use std::mem::MaybeUninit;
78

89
pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
910
// CHECK-NOT: memset
1011
[MaybeUninit::uninit(); 3000]
1112
}
13+
14+
pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
15+
// CHECK-NOT: memset
16+
[const { MaybeUninit::uninit() }; 8192]
17+
}

0 commit comments

Comments
 (0)