rust/src/test/ui/consts/const-err4.rs
2018-12-25 21:08:33 -07:00

14 lines
233 B
Rust

#[derive(Copy, Clone)]
union Foo {
a: isize,
b: (),
}
enum Bar {
Boo = [unsafe { Foo { b: () }.a }; 4][3],
//~^ ERROR it is undefined behavior to use this value
}
fn main() {
assert_ne!(Bar::Boo as isize, 0);
}