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-op / premise prove_assignable(env, assumptions, state, rhs_ty, &place.ty) => state

Premise at line 483. Observed failure causes: failed_judgment.

assign-op
LineCoverageSource
4711(borrow_check_expr(
env,
assumptions,
state,
rhs,
Seq(place, Assignment(place)).live_before(env, &state, places_live_on_exit),
) => (rhs_ty, state))
478N/A(let places_live_before_write = Assignment(place).live_before(env, &state, places_live_on_exit))
480✗(borrow_check_place_expr(env, assumptions, state, place) => (place, state))
481✗(prove_ty_is_rigid(env, assumptions, state, &place.ty) => (RigidTy { name: RigidName::ScalarId(scalar), parameters: _ }, state))
4821(if scalar.is_int())
4834(prove_assignable(env, assumptions, state, rhs_ty, &place.ty) => state)
4852(access_permitted(env, assumptions, state, Access::new(AccessKind::Read, place), places_live_before_write) => state)
4861(access_permitted(env, assumptions, state, Access::new(AccessKind::Write, place), places_live_on_exit) => state)
487N/A(let state = kill_loans(place, state))
──────── ("assign-op")
48919(borrow_check_expr(env, assumptions, state, Expr::AssignOp { place, op: _, rhs }, places_live_on_exit) => (Ty::unit(), state))

4 tests failed proving this premise:


Source location: tests/mir_typeck.rs:1532 (all coverage from this test)

fn main() -> () {
    let x: u32 = 12_u32;
    x ^= 3_i32;
}
Failed proof tree

Source location: tests/mir_typeck.rs:1648 (all coverage from this test)

fn main() -> () {
    let x: u32 = 12_u32;
    x |= 3_i32;
}
Failed proof tree

Source location: tests/mir_typeck.rs:1764 (all coverage from this test)

fn main() -> () {
    let x: u32 = 12_u32;
    x &= 3_i32;
}
Failed proof tree

Source location: tests/mir_typeck.rs:1989 (all coverage from this test)

fn foo() -> () {
    let x: u32 = 1_u32;
    x += 2_u8;
}
Failed proof tree

How to read this page