summary refs log tree commit diff
path: root/src/test/ui/consts/const-err4.rs
blob: 70d9bc149d8d83cc47ea4736d2779c11dd6f9f65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[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);
}