]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-err4.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-err4.rs
1 #[derive(Copy, Clone)]
2 union Foo {
3     a: isize,
4     b: (),
5 }
6
7 enum Bar {
8     Boo = [unsafe { Foo { b: () }.a }; 4][3],
9     //~^ ERROR it is undefined behavior to use this value
10 }
11
12 fn main() {
13     assert_ne!(Bar::Boo as isize, 0);
14 }