summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-err4.rs
blob: f0625faa80179dd783d4c2ac392446d7d1c56b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// stderr-per-bitwidth
#[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);
}