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 / expr / premise borrow_check_expr( env, assumptions, state, expr, places_live_on_exit ) => (_init_ty, state)

Premise at line 229. Observed failure causes: failed_judgment.

expr
LineCoverageSource
22912(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_init_ty, state))
──────── ("expr")
23715(borrow_check_statement(env, assumptions, state, Stmt::Expr { expr }, places_live_on_exit) => (env, state))

12 tests failed proving this premise:


Source location: tests/borrowck.rs:212

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

Source location: tests/borrowck.rs:1881

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

Source location: tests/borrowck.rs:1919

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:2192

fn foo<'a, 'b>(v1: &'a u32, v2: &'b u32) -> () {
    let output: &'b u32 = v2;
    loop {
        output = v1;
    }
}
Failed proof tree

Source location: tests/borrowck.rs:2477

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let x: i32 = 0 _ i32;
        let r: &'r0 i32;
        'a: loop {
            r; // this *may* read from `y` in a previous iteration
            let y: i32 = 0 _ i32;
            r = &'r1 y;
            continue 'a;
        }
    }
}
Failed proof tree

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

Source location: tests/borrowck.rs:2765

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:2992

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

Source location: tests/borrowck.rs:3063

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

Source location: tests/borrowck.rs:3185

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/mir_typeck.rs:595

fn foo (v1: u32) -> u32 {
    let v2: Dummy = Dummy { value: 1 _ u32 };
    v2.nonexistent = 2 _ u32;
    return v1;
}

Proof trees omitted for the remaining 2 tests.


Source location: tests/mir_typeck.rs:613

fn foo (v1: u32) -> u32 {
    let v2: Dummy = Dummy { value: 1 _ u32 };
    v1.value = 2 _ u32;
    return v1;
}