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_expr / assign / premise borrow_check_expr( env, assumptions, state, expr, Assignment(place).live_before(env, &state, places_live_on_exit), ) => (value_ty, state)

Premise at line 397. Observed failure causes: failed_judgment.

assign
LineCoverageSource
3971(borrow_check_expr(
env,
assumptions,
state,
expr,
Assignment(place).live_before(env, &state, places_live_on_exit),
) => (value_ty, state))
4062(borrow_check_place_expr(
env,
assumptions,
state,
place,
) => (place, state))
4141(prove_assignable(env, assumptions, state, value_ty, &place.ty) => state)
41611(access_permitted(
env,
assumptions,
state,
Access::new(AccessKind::Write, place),
places_live_on_exit,
) => state)
424N/A(let state = kill_loans(place, state))
425N/A(let state = state.with_initialized(&place.to_place_expression()))
──────── ("assign")
42727(borrow_check_expr(env, assumptions, state, Expr::Assign { place, expr }, places_live_on_exit) => (Ty::unit(), state))

1 test failed proving this premise:


Source location: tests/borrowck.rs:5149 (all coverage from this test)

fn foo() -> () {
    let x: u32 = 1_u32;
    exists<'a> {
        let r: &'a mut u32 = &'a mut x;
        x = x + *r;
    }
}
Failed proof tree

How to read this page