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_place_is_movable / copy

copy
LineCoverageSource
10133(prove_ty_is_copy(env, assumptions, state, &place.ty) => state)
──────── ("copy")
10159(prove_place_is_movable(env, assumptions, state, place) => state)

9 tests exercised this rule:


Source location: tests/borrowck.rs:2105

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 1486 nodes shown)

Source location: tests/borrowck.rs:2474

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 = &mut 'loan_0 a;
        let p: &'l_p mut u32 = &mut 'loan_1 a;
        if true {
            p = &mut 'loan_1 a;
            q = &mut 'loan_2 b;
        } else {
            p = &mut 'loan_3 b;
        }
        *q = 1_u32;
        return *p;
    }
}
Proof tree
… (200 of 2142 nodes shown)

Source location: tests/borrowck.rs:2664

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 1922 nodes shown)

Source location: tests/borrowck.rs:2933

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

Source location: tests/borrowck.rs:3027

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 1451 nodes shown)

Source location: tests/field_projections.rs:17

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

Source location: tests/mir_typeck.rs:710

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

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

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