]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/dangling-alloc-id-ice.rs
Rollup merge of #84392 - dario23:fmt-assert-args-pub, r=varkor,RalfJung
[rust.git] / src / test / ui / consts / dangling-alloc-id-ice.rs
1 // https://github.com/rust-lang/rust/issues/55223
2 #![allow(const_err)]
3
4 union Foo<'a> {
5     y: &'a (),
6     long_live_the_unit: &'static (),
7 }
8
9 const FOO: &() = {
10 //~^ ERROR encountered dangling pointer in final constant
11     let y = ();
12     unsafe { Foo { y: &y }.long_live_the_unit }
13 };
14
15 fn main() {}