]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/dangling-alloc-id-ice.rs
Auto merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, r=nikomatsakis
[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() {}