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: access_permitted_by_loan / read-shared is ok

read-shared is ok
LineCoverageSource
──────── ("read-shared is ok")
9666(access_permitted_by_loan(
_env,
_assumptions,
state,
Loan { kind: RefKind::Shared, .. },
Access { kind: AccessKind::Read, .. },
_live_places,
) => state)

6 tests exercised this rule:


Source location: tests/borrowck.rs:5201 (all coverage from this test)

fn foo() -> u32 {
    exists<'l0> {
        let a: u32 = 0_u32;
        let p: &'l0 u32 = &'l0 a;
        let q: &'l0 u32 = p;
        let r: &'l0 u32 = p;
        p;
        return 0_u32;
    }
}
Proof tree
… (200 of 1524 nodes shown)

Source location: tests/borrowck.rs:5620 (all coverage from this test)

fn f() -> u32 {
    exists<'r0, 'r1> {
        let v: u32 = 0_u32;
        let x: u32 = ss::<'r0, 'r1>(&'r0 v, &'r1 v);
        return x;
    }
}
Proof tree
… (200 of 1509 nodes shown)

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

fn main() -> () {
    let x: i32 = 42_i32;
    exists<'a> {
        let r1: & 'a i32 = & 'a x;
        let r2: & 'a i32 = & 'a *r1;
        println!(*r2);
    }
}
Proof tree
… (200 of 1830 nodes shown)

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

fn main() -> () {
    let x: u32 = 12_u32;
    exists<'a, 'b> {
        let r: &'a u32 = &'a x;
        println!(and_left::<'a>(r));
        let s: &'b u32 = &'b x;
        println!(and_right::<'b>(s));
    }
}
Proof tree
… (200 of 2027 nodes shown)

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

fn main() -> () {
    let x: u32 = 12_u32;
    exists<'a> {
        let r: &'a u32 = &'a x;
        println!(*r & *r);
        println!(*r & 6_u32);
    }
}
Proof tree
… (200 of 2366 nodes shown)

Source location: tests/pr502_liveness_prototypes.rs:26 (all coverage from this test)

fn f() -> () {
    exists<'r0, 'r1> {
        let v: u32 = 0_u32;
        let w: u32 = 1_u32;
        let r: &'r0 u32 = &'r0 v;
        pair::<'r1, 'r0>(&'r1 mut v, after_reset::<'r0>(r = &'r0 w, r));
    }
}
Proof tree
… (200 of 1756 nodes shown)

How to read this page