mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
add a test
This commit is contained in:
parent
b85178a5fc
commit
468c617c21
17
src/test/ui/consts/extra-const-ub/issue-101034.rs
Normal file
17
src/test/ui/consts/extra-const-ub/issue-101034.rs
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user