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 / bitwise or

bitwise or
LineCoverageSource
414N/A(let expr = Expr::bin_op(lhs, BinOpKind::BitOr, rhs))
4153(borrow_check_expr(env, assumptions, state, expr, places_live_on_exit) => (ty, state))
──────── ("bitwise or")
41713(borrow_check_expr(env, assumptions, state, Expr::BitOr { lhs, rhs }, places_live_on_exit) => (ty, state))

13 tests exercised this rule:


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

fn main() -> () {
    println!(12_i32 | 10_i32);
}
Proof tree
… (200 of 1301 nodes shown)

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

fn main() -> () {
    println!(1_i32 | 2_i32 ^ 3_i32);
    println!(5_i32 ^ 1_i32 | 1_i32);
}
Proof tree
… (200 of 1334 nodes shown)

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

fn main() -> () {
    println!(3_i32 | 1_i32 + 1_i32);
    println!(3_i32 + 1_i32 | 1_i32);
    println!(9_i32 - 1_i32 | 1_i32);
    println!(5_i32 | 2_i32 * 3_i32);
}
Proof tree
… (200 of 1377 nodes shown)

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

fn main() -> () {
    println!(-16_i32 | 5_i32);
    println!(-8_i32 | -3_i32);
}
Proof tree
… (200 of 1314 nodes shown)

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

fn main() -> () {
    println!(240_u8 | 15_u8);
}
Proof tree
… (200 of 1301 nodes shown)

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

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

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

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

fn main() -> () {
    println!((1_i32 | 2_i32) ^ 3_i32);
    println!(2_i32 * (1_i32 | 4_i32));
}
Proof tree
… (200 of 1336 nodes shown)

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

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

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

fn main() -> () {
    println!(-128_i8 | 127_i8);
    println!(64_i8 | 63_i8);
}
Proof tree
… (200 of 1314 nodes shown)

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

fn main() -> () {
    println!(170141183460469231731687303715884105728_u128
        | 170141183460469231731687303715884105727_u128);
    println!(170141183460469231731687303715884105728_u128 | 1_u128);
    println!(-170141183460469231731687303715884105728_i128
        | 170141183460469231731687303715884105727_i128);
}
Proof tree
… (200 of 1327 nodes shown)

Source location: tests/pr531_review_probes.rs:16 (all coverage from this test)

fn main() -> () {
    let x: u32 = 4_u32;
    exists<'a> {
        let r: &'a mut u32 = &'a mut x;
        println!(*r | x);
    }
}

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


Source location: tests/pr531_review_probes.rs:55 (all coverage from this test)

fn main() -> () {
    let x: u128 = 170141183460469231731687303715884105728_u128;
    x |= identity(1_u128 | 2_u128 ^ 3_u128);
    println!(x);
    println!(identity((1_u128 | 2_u128) ^ 3_u128));
}

Source location: tests/pr539_review_probes.rs:16 (all coverage from this test)

fn main() -> () {
    println!(identity(8_u32 | 6_u32 ^ 3_u32 & 1_u32));
    println!(identity((8_u32 | 6_u32 ^ 3_u32) & 1_u32));
    println!(identity(0_u32 & observed()));
}

How to read this page