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 access_permitted( env, assumptions, state, Access::new(AccessKind::Write, place), places_live_on_exit, ) => state

Premise at line 455. Observed failure causes: failed_judgment.

assign
LineCoverageSource
4361(borrow_check_expr(
env,
assumptions,
state,
expr,
Assignment(place).live_before(env, &state, places_live_on_exit),
) => (value_ty, state))
4452(borrow_check_place_expr(
env,
assumptions,
state,
place,
) => (place, state))
4531(prove_assignable(env, assumptions, state, value_ty, &place.ty) => state)
45516(access_permitted(
env,
assumptions,
state,
Access::new(AccessKind::Write, place),
places_live_on_exit,
) => state)
463N/A(let state = kill_loans(place, state))
464N/A(let state = state.with_initialized(&place.to_place_expression()))
──────── ("assign")
46643(borrow_check_expr(env, assumptions, state, Expr::Assign { place, expr }, places_live_on_exit) => (Ty::unit(), state))

16 tests failed proving this premise:


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

fn foo() -> u32 {
    let x: Pair;
    x.first = 1_u32;
    return 0_u32;
}
Failed proof tree

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v1: i32 = 0_i32;
        let v2: &'r0 mut i32 = &'r1 mut v1;
        // This should result in an error
        v1 = 1_i32;
        return *v2;
    }
}
Failed proof tree

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v1: i32 = 0_i32;
        let v2: &'r0 i32 = &'r1 v1;
        v1 = 1_i32;
        return *v2;
    }
}
Failed proof tree

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

fn foo() -> i32 {
    exists<'r> {
        let v3: i32 = 0_i32;
        let v4: &'r i32 = &'r v3;
    }
    exists<'r0, 'r1> {
        let v1: i32 = 0_i32;
        let v2: &'r0 i32 = &'r1 v1;
        v1 = 1_i32;
        return *v2;
    }
}
Failed proof tree

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

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

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

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

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let p: Point = Point { x: 0_u32, y: 0_u32 };
        let b1: &'r0 mut u32 = &'r1 mut p.x;
        p.x = 1_u32;
        return *b1;
    }
}
Failed proof tree

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

fn foo() -> u32 {
    exists<'r0> {
        let v1: u32 = 0_u32;
        let w: Wrapper<'r0> = Wrapper::<'r0> { value: &'r0 mut v1 };
        v1 = 1_u32;
        return *(w.value);
    }
}
Failed proof tree

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

fn foo() -> u32 {
    exists<'r0, 'r1, 'r2> {
        let x: u32 = 22_u32;
        let p: &'r1 u32 = &'r0 x;
        let q: &'r2 u32 = p;
        x = 1_u32;
        q;
        return 0_u32;
    }
}
Failed proof tree

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let x: u32 = 22_u32;
        let helper: &'r1 u32 = &'r0 x;
        x = 1_u32;
        helper;
        return 0_u32;
    }
}
Failed proof tree

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

fn remove_last_node_iterative<'a>(node: &'a mut List) -> u32 {
    exists<'r0, 'r1> {
        let cursor: &'r0 mut List = &'r0 mut *node;
        'l: loop {
            let next: &'r1 mut List = &'r1 mut *cursor;
            if true {
                cursor = next;
            } else {
                break 'l;
            }
        }
        *cursor = List { value: 0_u32 };
        return 0_u32;
    }
}

Proof trees omitted for the remaining 6 tests; each one is on its test’s page in Coverage by test.


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

fn main() -> () {
    let v0: u32 = 0_u32;
    exists<'a, 'b> {
        let p: &'a u32 = &'a v0;
        let q: &'b u32;
        exists<'r> {
            let m: &'r u32 = p;
            q = m;
        }
        v0 = 1_u32;
        let z: u32 = *q;
    }
}

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

fn main() -> () {
    let v0: u32 = 0_u32;
    exists<'b> {
        let q: &'b u32;
        exists<'r> {
            let m: &'r u32 = &'r v0;
            q = m;
        }
        v0 = 1_u32;
        let z: u32 = *q;
    }
}

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

fn main() -> () {
    let v0: u32 = 0_u32;
    exists<'b1, 'b2> {
        let q1: &'b1 u32;
        let q2: &'b2 u32;
        exists<'r> {
            let m: &'r u32 = &'r v0;
            q1 = m;
            q2 = m;
        }
        let z1: u32 = *q1;
        v0 = 1_u32;
        let z2: u32 = *q2;
    }
}

Source location: tests/higher_ranked_where_clauses.rs:151 (all coverage from this test)

fn foo<T>() -> u32 where for<'a> T: Trait<'a> {
    let v: u32 = 1_u32;
    exists<'r> {
        let r: &'r u32 = first::<'r, T>(&'r v);
        v = 2_u32;
        return *r;
    }
}

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

fn main() -> () {
    let v0: u32 = 0_u32;
    exists<'r> {
        let v1: &'r u32 = &'r v0;
        needs_all::<&'r u32>(v1);
        v0 = 1_u32;
    }
}

How to read this page