rust/tests/ui/consts/const-eval/union_promotion.rs
2025-04-08 23:06:31 +03:00

12 lines
211 B
Rust

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