Skip to content

Commit

Permalink
Rollup merge of #101180 - SUPERCILEX:const-maybeuninit, r=TaKO8Ki
Browse files Browse the repository at this point in the history
Add another MaybeUninit array test with const

This is another possible syntax and I just want to be absolutely sure it behaves correctly.
  • Loading branch information
Dylan-DPC authored Aug 30, 2022
2 parents c467370 + eaa0025 commit ec95a92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/codegen/issue-96274.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
// compile-flags: -O

#![crate_type = "lib"]
#![feature(inline_const)]

use std::mem::MaybeUninit;

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]
}

0 comments on commit ec95a92

Please sign in to comment.