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

Positive coverage: borrow_check_statement / block

block
LineCoverageSource
2904(borrow_check_block(env, assumptions, state, block, places_live_on_exit) => state)
──────── ("block")
2926(borrow_check_statement(env, assumptions, state, Stmt::Block(block), places_live_on_exit) => (env, state))

6 tests exercised this rule:


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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let result: i32;
        {
            let v1: i32 = 22_i32;
            let v2: &'r0 i32 = &'r1 v1;
            result = *v2;
        }
        return result;
    }
}
Proof tree
… (200 of 1239 nodes shown)

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

fn foo() -> () {
    'a: {
        {
            let 'a: v: i32 = 0_i32;
        }
    }
}
Proof tree
… (200 of 1017 nodes shown)

Source location: tests/codegen.rs:127 (all coverage from this test)

fn main() -> () {
    {
        let x: i32 = 99_i32;
        println!(x);
    }
    exists<'a> {
        println!(1_i32);
    }
}
Proof tree
… (200 of 1032 nodes shown)

Source location: tests/codegen.rs:461 (all coverage from this test)

fn main() -> () {
    let x: i32 = 0_i32;
    'a: loop {
        {
            x = 88_i32;
            break 'a;
        }
    }
    println!(x);
}
Proof tree
… (200 of 1063 nodes shown)

Source location: tests/codegen.rs:477 (all coverage from this test)

fn main() -> () {
    'a: {
        println!(1_i32);
        break 'a;
        println!(2_i32);
    }
    println!(3_i32);
}
Proof tree
… (200 of 1003 nodes shown)

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

fn foo() -> u32 {
    'a: {
        break 'a;
    }
    return 0_u32;
}
Proof tree
… (200 of 1002 nodes shown)