2018-10-22 08:45:03 -05:00
|
|
|
// https://github.com/rust-lang/rust/issues/55223
|
|
|
|
|
|
|
|
union Foo<'a> {
|
|
|
|
y: &'a (),
|
|
|
|
long_live_the_unit: &'static (),
|
|
|
|
}
|
|
|
|
|
2020-11-05 01:54:21 -06:00
|
|
|
const FOO: &() = {
|
2020-04-29 05:34:51 -05:00
|
|
|
//~^ ERROR encountered dangling pointer in final constant
|
2018-10-22 08:45:03 -05:00
|
|
|
let y = ();
|
|
|
|
unsafe { Foo { y: &y }.long_live_the_unit }
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|