diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-08-30 11:26:55 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-30 11:26:55 +0530 |
| commit | ec95a929044afad3cfad99231378a27870a9e28c (patch) | |
| tree | 80fb103ff5db86dd468468e693cbdea387b83e19 | |
| parent | c467370b9afc109debef1a21d3bae0b32b5ee31c (diff) | |
| parent | eaa00250ba29f5833f1195891eff10fff8099d4b (diff) | |
| download | rust-ec95a929044afad3cfad99231378a27870a9e28c.tar.gz rust-ec95a929044afad3cfad99231378a27870a9e28c.zip | |
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.
| -rw-r--r-- | src/test/codegen/issue-96274.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/codegen/issue-96274.rs b/src/test/codegen/issue-96274.rs index e3abf730961..28bfcce0d7b 100644 --- a/src/test/codegen/issue-96274.rs +++ b/src/test/codegen/issue-96274.rs @@ -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] +} |
