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, else_block, places_live_on_exit) => else_state

Premise at line 220. 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/mir_typeck.rs:147

fn foo (b: bool) -> u32 {
    if b {
        return 1 _ u32;
    } else {
        return false;
    }
}
Failed proof tree