summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/union_promotion.rs
blob: 18894c45fd822cdd6f39891d183cba329c8ed095 (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 { //~ temporary value dropped while borrowed
        Foo { a: &1 }.b == Foo { a: &2 }.b
    };
}