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 / print

print
LineCoverageSource
338(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_expr_ty, state))
──────── ("print")
34624(borrow_check_statement(env, assumptions, state, Stmt::Print { expr }, places_live_on_exit) => (env, state))

24 tests exercised this rule:


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

fn main() -> () {
    println!(22_i32);
}
Proof tree
… (200 of 989 nodes shown)

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

fn main() -> () {
    println!(1_i32);
    println!(true);
    println!(false);
}
Proof tree
… (200 of 995 nodes shown)

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

fn main() -> () {
    let x: i32 = 42_i32;
    println!(x);
}
Proof tree
… (200 of 1013 nodes shown)

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

fn main() -> () {
    let x: i32 = 1_i32;
    x = 2 _ i32;
    println!(x);
}
Proof tree
… (200 of 1025 nodes shown)

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

fn main() -> () {
    let y: i32 = add_one(1_i32);
    println!(y);
}
Proof tree
… (200 of 1060 nodes shown)

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

fn main() -> () {
    let y: i32 = identity::<i32>(42_i32);
    println!(y);
}
Proof tree
… (200 of 1060 nodes shown)

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

fn main() -> () {
    let x: i32 = 1_i32;
    if true {
        println!(x);
    } else {
        println!(0_i32);
    }
}
Proof tree
… (200 of 1031 nodes shown)

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

fn main() -> () {
    let x: i32 = 0_i32;
    'a: loop {
        println!(x);
        break 'a;
    }
}
Proof tree
… (200 of 1037 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:141 (all coverage from this test)

fn main() -> () {
    let p: Pair = Pair { x: 10_i32, y: 20_i32 };
    println!(p.x);
    println!(p.y);
}
Proof tree
… (200 of 1068 nodes shown)

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

fn main() -> () {
    let a: usize = 100_usize;
    let b: isize = 200_isize;
    println!(a);
    println!(b);
}

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


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

fn main() -> () {
    let a: i32 = f(1_i32);
    let b: i32 = f(2_i32);
    let c: i32 = f(3_i32);
    println!(a);
    println!(b);
    println!(c);
}

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

fn main() -> () {
    let y: i32 = f(f(42_i32));
    println!(y);
}

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

fn main() -> () {
    let r: i32 = outer(7_i32);
    println!(r);
}

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

fn main() -> () {
    a();
}

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

fn main() -> () {
    let r: i32 = first::<i32, bool>(10_i32, true);
    println!(r);
}

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

fn main() -> () {
    let w: Wrapper<i32> = Wrapper::<i32> { val: 42_i32 };
    println!(w.val);
}

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

fn main() -> () {
    let x: i32 = 0_i32;
    'a: loop {
        if true {
            println!(x);
            break 'a;
        } else {
            continue 'a;
        }
    }
}

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

fn main() -> () {
    'outer: loop {
        println!(1_i32);
        'inner: loop {
            println!(2_i32);
            break 'outer;
        }
    }
    println!(3_i32);
}

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

fn main() -> () {
    'a: loop {
        if true {
            println!(1_i32);
            break 'a;
        } else {
            println!(2_i32);
            break 'a;
        }
    }
    println!(3_i32);
}

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

fn main() -> () {
    let x: i32 = 0_i32;
    'a: loop {
        if false {
            x = 1_i32;
            break 'a;
        } else {
            x = 2_i32;
            break 'a;
        }
    }
    println!(x);
}

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

fn main() -> () {
    let x: i32 = 0_i32;
    'a: loop {
        x = 77_i32;
        break 'a;
    }
    println!(x);
}

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);
}

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);
}