diff options
| author | Ralf Jung <post@ralfj.de> | 2022-08-26 11:04:13 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-08-26 11:04:13 -0400 |
| commit | 468c617c2124b0b50eedab634656d213fc1e033d (patch) | |
| tree | 363b8f72a37cec6de80506d0d72c082a8c7e96ac | |
| parent | b85178a5fccb0d582fdbf23625c531af170cc882 (diff) | |
| download | rust-468c617c2124b0b50eedab634656d213fc1e033d.tar.gz rust-468c617c2124b0b50eedab634656d213fc1e033d.zip | |
add a test
| -rw-r--r-- | src/test/ui/consts/extra-const-ub/issue-101034.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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; +} |
