mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
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
@ -2,6 +2,7 @@
|
|||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
#![feature(inline_const)]
|
||||||
|
|
||||||
use std::mem::MaybeUninit;
|
use std::mem::MaybeUninit;
|
||||||
|
|
||||||
@ -9,3 +10,8 @@ pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
|
|||||||
// CHECK-NOT: memset
|
// CHECK-NOT: memset
|
||||||
[MaybeUninit::uninit(); 3000]
|
[MaybeUninit::uninit(); 3000]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
|
||||||
|
// CHECK-NOT: memset
|
||||||
|
[const { MaybeUninit::uninit() }; 8192]
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user