rust/tests/ui/consts/const-err-enum-discriminant.rs
2024-01-11 14:57:12 +01:00

16 lines
249 B
Rust

#[derive(Copy, Clone)]
union Foo {
a: isize,
b: (),
}
enum Bar {
Boo = [unsafe { Foo { b: () }.a }; 4][3],
//~^ ERROR evaluation of constant value failed
//~| uninitialized
}
fn main() {
assert_ne!(Bar::Boo as isize, 0);
}