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

Negative coverage: borrow_check_statement / if / premise borrow_check_block(env, assumptions, state, then_block, places_live_on_exit) => then_state

Premise at line 219. Observed failure causes: failed_judgment.

if
LineCoverageSource
209(borrow_check_expr_has_ty(
env,
assumptions,
state,
condition,
Ty::bool(),
Either(then_block, else_block).live_before(env, &state, places_live_on_exit),
) => state)
2191(borrow_check_block(env, assumptions, state, then_block, places_live_on_exit) => then_state)
2201(borrow_check_block(env, assumptions, state, else_block, places_live_on_exit) => else_state)
223N/A(let state: FlowState = Union((then_state, else_state)).upcast())
──────── ("if")
22514(borrow_check_statement(env, assumptions, state, Stmt::If { condition, then_block, else_block }, places_live_on_exit) => (env, state))

1 test failed proving this premise:


Source location: tests/borrowck.rs:2671

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let a: u32 = 22 _ u32;
        let p: &'r0 u32 = &'r1 a;
        'l: loop {
            if true {
                a = 23 _ u32;
                continue 'l;
            } else {
                break 'l;
            }
        }
        return *p;
    }
}
Failed proof tree