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_loop / fixed-point / premise borrow_check_block(env, assumptions, state0, body, places_live_on_exit) => state1

Premise at line 555. Observed failure causes: failed_judgment.

fixed-point
LineCoverageSource
5556(borrow_check_block(env, assumptions, state0, body, places_live_on_exit) => state1)
556(if state0 == state1)
──────── ("fixed-point")
55813(borrow_check_loop(env, assumptions, state0, body, places_live_on_exit) => state1)

6 tests failed proving this premise:


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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let r: &'r0 i32;
        'a: loop {
            let y: i32 = 0 _ i32;
            r = &'r1 y;
            continue 'a;
        }
        r; // only an error because of false edges, assumption that all loops terminate
    }
}
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:2544

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let r: &'r0 i32;
        'a: loop {
            let x: i32 = 0 _ i32;
            r = &'r1 x;
            break 'a;
        }
        return *r;
    }
}
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/mir_typeck.rs:776

fn foo() -> u32 {
    loop {
        break 'nonexistent;
    }
    return 0 _ u32;
}
Failed proof tree