summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-storage-dead.rs
blob: fe9844610425e37296c57a3c345bdedf942404af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fn ok() {
    loop {
        let _x = 1;
    }
}

fn also_ok() {
    loop {
        let _x = String::new();
    }
}

fn fail() {
    loop {
        let x: i32;
        let _ = x + 1; //~ERROR [E0381]
    }
}

fn main() {
    ok();
    also_ok();
    fail();
}