about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/union_promotion.rs
blob: 3868b0b18b1eeb65c6b67abfe2cc113bf805cf9f (plain)
1
2
3
4
5
6
7
8
9
10
11
#[repr(C)]
union Foo {
    a: &'static u32,
    b: usize,
}

fn main() {
    let x: &'static bool = &unsafe { //~ ERROR temporary value dropped while borrowed
        Foo { a: &1 }.b == Foo { a: &2 }.b
    };
}