mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
15 lines
289 B
Rust
15 lines
289 B
Rust
// https://github.com/rust-lang/rust/issues/55223
|
|
|
|
union Foo<'a> {
|
|
y: &'a (),
|
|
long_live_the_unit: &'static (),
|
|
}
|
|
|
|
const FOO: &() = {
|
|
//~^ ERROR encountered dangling pointer in final value of constant
|
|
let y = ();
|
|
unsafe { Foo { y: &y }.long_live_the_unit }
|
|
};
|
|
|
|
fn main() {}
|