Rollup merge of #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.
This commit is contained in:
commit
ec95a92904
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
// compile-flags: -O
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(inline_const)]
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
|
@ -9,3 +10,8 @@ pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
|
|||
// CHECK-NOT: memset
|
||||
[MaybeUninit::uninit(); 3000]
|
||||
}
|
||||
|
||||
pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
|
||||
// CHECK-NOT: memset
|
||||
[const { MaybeUninit::uninit() }; 8192]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue