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
306(borrow_check_expr(
env,
assumptions,
state,
expr,
places_live_on_exit
) => (_expr_ty, state))
──────── ("print")
31424(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

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

Source location: tests/codegen.rs:24

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

Source location: tests/codegen.rs:36

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

Source location: tests/codegen.rs:49

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

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

Source location: tests/codegen.rs:79

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

Source location: tests/codegen.rs:95

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

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

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

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

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

Proof trees omitted for the remaining 14 tests.


Source location: tests/codegen.rs:188

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

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

Source location: tests/codegen.rs:218

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

Source location: tests/codegen.rs:238

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

Source location: tests/codegen.rs:251

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

Source location: tests/codegen.rs:264

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

Source location: tests/codegen.rs:318

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

Source location: tests/codegen.rs:336

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

Source location: tests/codegen.rs:356

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

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

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

Source location: tests/codegen.rs:461

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

Source location: tests/codegen.rs:477

fn main() -> () {
    'a: {
        println!(1 _ i32);
        break 'a;
        println!(2 _ i32);
    }
    println!(3 _ i32);
}