From 468c617c2124b0b50eedab634656d213fc1e033d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 26 Aug 2022 11:04:13 -0400 Subject: [PATCH] add a test --- .../ui/consts/extra-const-ub/issue-101034.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/ui/consts/extra-const-ub/issue-101034.rs diff --git a/src/test/ui/consts/extra-const-ub/issue-101034.rs b/src/test/ui/consts/extra-const-ub/issue-101034.rs new file mode 100644 index 00000000000..e0de705c488 --- /dev/null +++ b/src/test/ui/consts/extra-const-ub/issue-101034.rs @@ -0,0 +1,17 @@ +// check-pass +// compile-flags: -Zextra-const-ub-checks + +#[repr(packed)] +pub struct Foo { + bar: u8, + baa: [u32; 1], +} + +const FOOMP: Foo = Foo { + bar: 0, + baa: [69; 1], +}; + +fn main() { + let _val = FOOMP; +}