summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-while-break.rs
blob: 7100b713031d2375d5111a5c773e6ef09ed1770e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn test(cond: bool) {
    let v;
    while cond {
        v = 3;
        break;
    }
    println!("{}", v); //~ ERROR E0381
}

fn main() {
    test(true);
}