rust/tests/ui/consts/const-eval/union_promotion.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
205 B
Rust
Raw Normal View History

#[repr(C)]
2018-06-03 12:00:22 -05:00
union Foo {
a: &'static u32,
b: usize,
}
fn main() {
let x: &'static bool = &unsafe { //~ temporary value dropped while borrowed
2018-06-03 12:00:22 -05:00
Foo { a: &1 }.b == Foo { a: &2 }.b
};
}