]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/dangling-alloc-id-ice.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / dangling-alloc-id-ice.rs
1 // https://github.com/rust-lang/rust/issues/55223
2
3 union Foo<'a> {
4     y: &'a (),
5     long_live_the_unit: &'static (),
6 }
7
8 const FOO: &() = { //~ ERROR any use of this value will cause an error
9     let y = ();
10     unsafe { Foo { y: &y }.long_live_the_unit }
11 };
12
13 fn main() {}