blob: 3b7f1de5b9bea728a515009a026958a2659bb6da [file] [log] [blame]
// https://github.com/rust-lang/rust/issues/55223
#![allow(const_err)]
union Foo<'a> {
y: &'a (),
long_live_the_unit: &'static (),
}
const FOO: &() = { //~ ERROR it is undefined behavior to use this value
//~^ ERROR encountered dangling pointer in final constant
let y = ();
unsafe { Foo { y: &y }.long_live_the_unit }
};
fn main() {}