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