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
2894(borrow_check_block(env, assumptions, state, block, places_live_on_exit) => state)
──────── ("block")
2916(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:2041

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 1234 nodes shown)

Source location: tests/borrowck.rs:2628

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

Source location: tests/codegen.rs:127

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

Source location: tests/codegen.rs:461

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

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

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