summaryrefslogtreecommitdiff
path: root/tests/src/loops-borrow-check.rs
blob: ab300b371b2e247413b2a78468c755832a1b0ab0 (plain)
1
2
3
4
5
6
7
8
9
10
//@ [!borrow-check] skip

fn iter_local_mut_borrow() {
    let mut x = 0;
    let mut p = &mut x;
    loop {
        p = &mut (*p);
        *p += 1;
    }
}