summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-52534-2.rs
blob: e416264ed09fd889f2a937d4353fc97c5c0fa094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn foo(x: &u32) -> &u32 {
    let y;

    {
        let x = 32;
        y = &x
//~^ ERROR does not live long enough
    }

    println!("{}", y);
    x
}

fn main() { }