]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/dangling-alloc-id-ice.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[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() {}