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

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
};
}