rust/tests/ui/consts/const-eval/union_promotion.rs
2023-01-11 09:32:08 +00:00

12 lines
205 B
Rust

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