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: prove_ty_is_copy / trait

trait
LineCoverageSource
967N/A(let goal = Predicate::is_implemented(TraitId::new("Copy").with(ty, Vec::<Parameter>::new())))
9683(env.prove_goal(assumptions, &state, goal) => state)
──────── ("trait")
9709(prove_ty_is_copy(env, assumptions, state, ty) => state)

9 tests exercised this rule:


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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let result: i32;
        {
            let v1: i32 = 22_i32;
            let v2: &'r0 i32 = &'r1 v1;
            result = *v2;
        }
        return result;
    }
}
Proof tree
… (200 of 1239 nodes shown)

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

fn foo () -> u32 {
    exists<'l_p, 'l_q, 'loan_0, 'loan_1, 'loan_2, 'loan_3> {
        let a: u32 = 0_u32;
        let b: u32 = 0_u32;
        // In Rustc, the 1-tuple is needed for some reason
        // Niko does not 100% understand, else rustc is able to
        // see that this program is safe.
        let q: &'l_q mut u32 = &'loan_0 mut a;
        let p: &'l_p mut u32 = &'loan_1 mut a;
        if true {
            p = &'loan_1 mut a;
            q = &'loan_2 mut b;
        } else {
            p = &'loan_3 mut b;
        }
        *q = 1_u32;
        return *p;
    }
}
Proof tree
… (200 of 1567 nodes shown)

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        'a: loop {
            let x: i32 = 0_i32;
            let r: &'r0 i32 = &'r1 x;
            let _y: i32 = *r;
            continue 'a;
        }
    }
}
Proof tree
… (200 of 1457 nodes shown)

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

fn bar() -> u32 {
    exists<'r1> {
        let v: u32 = 7_u32;
        let r: u32 = foo::<'r1>(&'r1 v);
        return r;
    }
}
Proof tree
… (200 of 1229 nodes shown)

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

fn bar() -> u32 {
    exists<'r0, 'r1> {
        let v: u32 = 1_u32;
        let p: &'r0 u32 = &'r1 v;
        foo(0_u32);
        return *p;
    }
}
Proof tree
… (200 of 1239 nodes shown)

Source location: tests/field_projections.rs:17 (all coverage from this test)

fn test(ptr: Ptr) -> () {
    let x: () = *ptr;
}
Proof tree
… (200 of 1149 nodes shown)

Source location: tests/mir_typeck.rs:941 (all coverage from this test)

fn foo () -> u32 {
    exists<'a> {
        let v0: u32 = 0_u32;
        let v1: &'a u32 = &'a v0;
        let v2: u32 = *v1;
        return v2;
    }
}
Proof tree
… (200 of 1414 nodes shown)

Source location: tests/mir_typeck.rs:961 (all coverage from this test)

fn foo<'a, T>(v1: &'a T) -> T
where
    T: Copy,
    T: 'a,
{
    exists<'r0> {
        let v2: T = *v1;
        return v2;
    }
}
Proof tree
… (200 of 1303 nodes shown)

Source location: tests/mir_typeck.rs:1116 (all coverage from this test)

fn foo<'a>(v1: &'a Pair) -> u32 {
    exists<'r0> {
        let v2: u32 = (*v1).value;
        return v2;
    }
}
Proof tree
… (200 of 1258 nodes shown)