]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/promote_const_let.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / consts / promote_const_let.rs
1 fn main() {
2     let x: &'static u32 = {
3         let y = 42;
4         &y //~ ERROR does not live long enough
5     };
6     let x: &'static u32 = &{ //~ ERROR temporary value dropped while borrowed
7         let y = 42;
8         y
9     };
10 }