Skip to content

Commit

Permalink
Add another MaybeUninit array test with const
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX committed Aug 30, 2022
1 parent 9f4d5d2 commit eaa0025
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 eaa0025

Please sign in to comment.