Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Positive coverage: borrow_check_statement / continue

continue
LineCoverageSource
267(if state.scope_has_label(label))
2681(if let Some(places_live_on_continue) = state.live_after_continue(label))
269N/A(let locals_to_drop = state.locals_dropped_to_label(label))
2701(drop_places(env, assumptions, state, locals_to_drop, places_live_on_continue) => state)
271N/A(let state = state.with_continue(label))
272N/A(let state = state.diverges())
──────── ("continue")
2743(borrow_check_statement(env, assumptions, state, Stmt::Continue { label }, places_live_on_exit) => (env, state))

3 tests exercised this rule:


Source location: tests/borrowck.rs:2600

fn foo() -> u32 {
    exists<'r0, 'r1> {
        'a: loop {
            let x: i32 = 0 _ i32;
            let r: &'r0 i32 = &'r1 x;
            let _y: i32 = *r;
            continue 'a;
        }
    }
}
Proof tree
… (200 of 1443 nodes shown)

Source location: tests/codegen.rs:318

fn main() -> () {
    let x: i32 = 0 _ i32;
    'a: loop {
        if true {
            println!(x);
            break 'a;
        } else {
            continue 'a;
        }
    }
}
Proof tree
… (200 of 1073 nodes shown)

Source location: tests/mir_typeck.rs:802

fn foo() -> u32 {
    'a: loop {
        continue 'a;
    }
    return 0 _ u32;
}
Proof tree
… (200 of 1010 nodes shown)