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_expr / multiplication

multiplication
LineCoverageSource
389N/A(let expr = Expr::BinOp { lhs: lhs.clone(), op: BinOpKind::Mul, rhs: rhs.clone() })
3902(borrow_check_expr(env, assumptions, state, expr, places_live_on_exit) => (ty, state))
──────── ("multiplication")
3927(borrow_check_expr(env, assumptions, state, Expr::Mul { lhs, rhs }, places_live_on_exit) => (ty, state))

7 tests exercised this rule:


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

fn main() -> () {
    println!(3_i32 * 4_i32);
}
Proof tree
… (200 of 3389 nodes shown)

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

fn main() -> () {
    println!(2_i32 + 3_i32 * 4_i32);
    println!(2_i32 * 3_i32 + 4_i32);
    println!(2_i32 + 3_i32 * 4_i32 * 2_i32);
}
Proof tree
… (200 of 3452 nodes shown)

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

fn main() -> () {
    println!(-3_i32 * 4_i32);
}
Proof tree
… (200 of 3389 nodes shown)

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

fn main() -> () {
    println!(3_u32 * 4_u32);
}
Proof tree
… (200 of 3389 nodes shown)

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

fn main() -> () { println!(left() * right()); }
}])
tc_ok()
ect_output("1\n2\n12\n")
);
}

#[test]
plication_with_parentheses() {
alityTest::new(crates![crate Foo {
fn main() -> () {
    println!((2_i32 + 3_i32) * 4_i32);
    println!(2_i32 * (3_i32 + 4_i32));
}
Proof tree
… (200 of 3453 nodes shown)

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

fn main() -> () {
    println!((2_i32 + 3_i32) * 4_i32);
    println!(2_i32 * (3_i32 + 4_i32));
}
Proof tree
… (200 of 3422 nodes shown)

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

fn main() -> () {
    println!(20_i32 - 2_i32 * 3_i32);
    println!((20_i32 - 2_i32) * 3_i32);
}
Proof tree
… (200 of 3421 nodes shown)

How to read this page