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

Negative coverage: check_fn / check fn / premise check_fn_body(program, env, assumptions, body, input_args, output_ty) => ()

Premise at line 55. Observed failure causes: failed_judgment.

check fn
LineCoverageSource
48N/A(let (env, bound_data) = env.instantiate_universally(&f.binder))
49N/A(let FnBoundData { input_args, output_ty, where_clauses, body } = bound_data)
50N/A(let assumptions: Wcs = (assumptions, where_clauses).to_wcs())
51(prove_where_clauses_well_formed(program, env, assumptions, where_clauses) => ())
52(for_all(input_arg in input_args)
(prove_goal(program, env, assumptions, Predicate::well_formed(&input_arg.ty)) => ()))
54(prove_goal(program, env, assumptions, Predicate::well_formed(output_ty)) => ())
5560(check_fn_body(program, env, assumptions, body, input_args, output_ty) => ())
──────── ("check fn")
5796(check_fn(program, env, assumptions, f, crate_id) => ())

60 tests failed proving this premise:


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

fn foo() -> u32 {
    let x: u32;
    return x;
}
Failed proof tree

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

fn foo() -> Datum {
    let x: Datum = Datum { value: 0_u32 };
    let y: Datum = x;
    let z: Datum = x;
    return z;
}
Failed proof tree

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

fn foo() -> u32 {
    let x: u32;
    if true {
        x = 1_u32;
    } else {
    }
    return x;
}
Failed proof tree

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

fn foo() -> u32 {
    let x: u32;
    if true {
        x = 1_u32;
    }
    return x;
}
Failed proof tree

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

fn foo() -> Datum {
    let x: Datum = Datum { value: 0_u32 };
    if true {
        let y: Datum = x;
    }
    let z: Datum = x;
    return z;
}
Failed proof tree

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

fn foo() -> u32 {
    let x: Pair;
    x.first = 1_u32;
    return 0_u32;
}
Failed proof tree

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

fn foo() -> u32 {
    let x: Pair = Pair {
        first: Datum { value: 1_u32 },
        second: Datum { value: 2_u32 },
    };
    let a: Datum = x.first;
    let b: Pair = x;
    return 0_u32;
}
Failed proof tree

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

fn foo() -> Datum {
    let x: Pair = Pair {
        first: Datum { value: 1_u32 },
        second: Datum { value: 2_u32 },
    };
    let a: Datum = x.first;
    let b: Datum = x.first;
    return b;
}
Failed proof tree

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

fn foo() -> Datum {
    let x: Pair = Pair {
        first: Datum { value: 1_u32 },
        second: Datum { value: 2_u32 },
    };
    let a: Pair = x;
    let b: Datum = x.first;
    return b;
}
Failed proof tree

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

fn foo() -> u32 {
    let x: Outer = Outer {
        foo: Inner { bar: 1_u32 },
    };
    let a: Inner = x.foo;
    let b: u32 = x.foo.bar;
    return b;
}
Failed proof tree

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

fn foo() -> Datum {
    exists<'r0, 'r1> {
        let x: Datum = Datum { value: 0_u32 };
        let r: &'r0 Datum = &'r1 x;
        let y: Datum = *r;
        return y;
    }
}

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


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

fn foo() -> Datum {
    exists<'r0, 'r1> {
        let x: Datum = Datum { value: 0_u32 };
        let r: &'r0 mut Datum = &'r1 mut x;
        let y: Datum = *r;
        return y;
    }
}

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

fn foo() -> Datum {
    exists<'r0, 'r1> {
        let x: Datum = Datum { value: 0_u32 };
        let r: &'r0 Datum = &'r1 x;
        let y: Datum = x;
        return *r;
    }
}

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

fn foo() -> u32 {
    let x: u32;
    return x;
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v1: i32 = 0_i32;
        let v2: &'r0 mut i32 = &'r1 mut v1;
        // This should result in an error
        v1 = 1_i32;
        return *v2;
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v1: i32 = 0_i32;
        let v2: &'r0 i32 = &'r1 v1;
        v1 = 1_i32;
        return *v2;
    }
}

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

fn min_problem_case_3<'a>(m: &'a mut Map) -> &'a mut Map {
    exists<'r0, 'r1> {
        let n: &'r0 mut Map = &'r0 mut *m;
        if true {
            return n;
        } else {
            let o: &'r1 mut Map = &'r1 mut *m;
            return o;
        }
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v2: &'r0 i32;
        {
            let v1: i32 = 0_i32;
            v2 = &'r1 v1;
        }
        return *v2;
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v2: &'r0 mut i32;
        {
            let v1: i32 = 0_i32;
            v2 = &'r1 mut v1;
        }
        return *v2;
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let v2: &'r0 i32;
        'a: {
            let v1: i32 = 0_i32;
            v2 = &'r1 v1;
            break 'a;
        }
        return *v2;
    }
}

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

fn foo<'a, 'b>(v1: &'a u32) -> &'b u32 {
    exists<'r0> {
        let v2: &'r0 u32 = v1;
        return v2;
    }
}

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

fn foo<'a, 'b>(v1: &'a u32, v2: &'b u32) -> () {
    let output: &'b u32 = v2;
    loop {
        output = v1;
    }
}

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

fn foo<'a, 'b, 'c>(v1: &'a u32) -> &'c u32
where
    'a: 'b,
{
    return v1;
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let r: &'r0 i32;
        'a: loop {
            let y: i32 = 0_i32;
            r = &'r1 y;
            continue 'a;
        }
        r; // only an error because of false edges, assumption that all loops terminate
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let x: i32 = 0_i32;
        let r: &'r0 i32;
        'a: loop {
            r; // this *may* read from `y` in a previous iteration
            let y: i32 = 0_i32;
            r = &'r1 y;
            continue 'a;
        }
    }
}

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

fn foo() -> i32 {
    exists<'r0, 'r1> {
        let r: &'r0 i32;
        'a: loop {
            let x: i32 = 0_i32;
            r = &'r1 x;
            break 'a;
        }
        return *r;
    }
}

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let a: u32 = 22_u32;
        let p: &'r0 u32 = &'r1 a;
        'l: loop {
            if true {
                a = 23_u32;
                continue 'l;
            } else {
                break 'l;
            }
        }
        return *p;
    }
}

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

fn foo<'a>(m: &'a mut Map) -> &'a mut Map {
    exists<'r0, 'r1> {
        let n: &'r0 mut Map = &'r0 mut *m;
        if false {
            return n;
        } else {
            let o: &'r1 mut Map = &'r1 mut *m;
            return o;
        }
    }
}

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

fn foo() -> u32 {
    exists<'r0, 'r1, 'r2> {
        let a: u32 = 22_u32;
        let b: u32 = 22_u32;
        let p: &'r0 u32 = &'r1 a;
        a = 23_u32;
        'l: loop {
            p = &'r2 b;
            break 'l;
        }
        return *p;
    }
}

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

fn foo<'a, 'b>(a: &'a u32) -> &'b u32 {
    let r: &'b u32 = identity::<&'b u32>(a);
    return r;
}

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

fn bar() -> u32 {
    exists<'r0, 'r1, 'r2> {
        let v: u32 = 0_u32;
        let p: &'r0 u32 = &'r1 v;
        let _: u32 = foo::<'r2>(&'r2 mut v);
        return *p;
    }
}

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let p: Point = Point { x: 0_u32, y: 0_u32 };
        let b1: &'r0 mut u32 = &'r1 mut p.x;
        p.x = 1_u32;
        return *b1;
    }
}

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let v1: u32 = 22_u32;
        let v2: &'r0 mut u32 = &'r1 mut v1;
        let w: Wrapper = Wrapper { value: v1 };
        return *v2;
    }
}

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

fn foo() -> u32 {
    exists<'r0> {
        let v1: u32 = 0_u32;
        let w: Wrapper<'r0> = Wrapper::<'r0> { value: &'r0 mut v1 };
        v1 = 1_u32;
        return *(w.value);
    }
}

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

fn reborrow<'a>(a: &'a mut u8) -> &'a mut u8 {
    exists<'r0, 'r1, 'r2, 'r3> {
        // This creates an outlives constraint
        let b: &'r1 mut u8 = &'r0 mut *a;
        if true {
            return b;
        } else {
            // this means the loan remains live
        }

        // If the outlives constraint propagated here,
        // we would get an error.
        let c: &'r3 mut u8 = &'r2 mut *a;
        return c;
    }
}

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

fn foo() -> u32 {
    exists<'r0, 'r1, 'r2> {
        let x: u32 = 22_u32;
        let p: &'r1 u32 = &'r0 x;
        let q: &'r2 u32 = p;
        x = 1_u32;
        q;
        return 0_u32;
    }
}

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

fn foo(f: Pair) -> () {
    let s: Datum = f.x;
}

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

fn foo() -> u32 {
    exists<'r0, 'r1> {
        let x: u32 = 22_u32;
        let helper: &'r1 u32 = &'r0 x;
        x = 1_u32;
        helper;
        return 0_u32;
    }
}

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

fn foo<'a, 'b>(p: &'a mut u32) -> u32 {
    let q: &'b mut u32 = &'b mut *p;
    q;
    return 0_u32;
}

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

fn remove_last_node_iterative<'a>(node: &'a mut List) -> u32 {
    exists<'r0, 'r1> {
        let cursor: &'r0 mut List = &'r0 mut *node;
        'l: loop {
            let next: &'r1 mut List = &'r1 mut *cursor;
            if true {
                cursor = next;
            } else {
                break 'l;
            }
        }
        *cursor = List { value: 0_u32 };
        return 0_u32;
    }
}

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

fn conditional() -> u32 {
    exists<'r0, 'r1, 'r2, 'r3> {
        let b: X = X { value: 0_u32 };
        let p: &'r0 mut X = &'r1 mut b;
        'l: loop {
            let now: &'r2 mut X = &'r2 mut *p;
            if true {
                if true {
                    let next: &'r3 mut X = next_of::<'r3>(&'r3 mut *now);
                    p = next;
                } else {
                }
            } else {
                break 'l;
            }
        }
        return 0_u32;
    }
}

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

fn next<'a>(d: &'a mut Decoder) -> &'a u32 {
    exists<'r0, 'r1> {
        'l: loop {
            let buf: &'r0 u32 = fill_buf::<'r0>(&'r0 mut (*d).buf_read);
            let s: &'r1 u32 = decode::<'r1>(buf);
            if true {
                return s;
            } else {
            }
        }
    }
}

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

fn next<'s>(f: &'s mut Filter) -> &'s mut u32 {
    exists<'r0, 'r1, 'r2> {
        'l: loop {
            let item: &'r0 mut u32 = iter_next::<'r0>(&'r0 mut (*f).iter);
            if true {
                let keep: bool = call_predicate::<'r1, 'r2>(&'r1 mut (*f).predicate, &'r2 *item);
                if keep {
                    return item;
                } else {
                }
            } else {
                break 'l;
            }
        }
        return no_item::<'s>();
    }
}

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

fn use_it<'a, 'b>() -> u32 {
    exists<'r0> {
        let v: Invariant<'r0> = create_invariant::<'r0>();
        if true {
            return sink::<'a, 'r0>(v);
        } else {
            return sink::<'b, 'r0>(v);
        }
    }
}

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

fn use_both<'a, 'b>() -> u32 {
    exists<'r0> {
        let v: Invariant<'r0> = create_invariant::<'r0>();
        let w: Invariant<'r0> = create_invariant::<'r0>();
        sink::<'a, 'r0>(v);
        sink::<'b, 'r0>(w);
        return 0_u32;
    }
}

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

fn foo (b: bool) -> u32 {
    if b {
        return 1_u32;
    } else {
        return false;
    }
}

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

fn foo() -> () {
    let s2: S2<S1>;
}

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

fn bar() -> u32 {
    let v1: u32 = foo(0_u32);
    return v1;
}

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

fn bar(v1: ()) -> () {
    let v0: () = foo(v1);
    return v0;
}

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

fn bar(v1: u32) -> u32 {
    let v0: u32 = identity(v1);
    return v0;
}

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

fn bar(v1: u32) -> u32 {
    let v0: u32 = identity::<bool>(v1);
    return v0;
}

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

fn bar(v1: u32) -> u32 {
    let v0: u32 = identity::<u32>(v1, v1);
    return v0;
}

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

fn bar(v1: u32) -> u32 {
    let v0: u32 = identity::<u32, u32>(v1);
    return v0;
}

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

fn foo (v1: ()) -> u32 {
    return v1;
}

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

fn foo (v1: u32) -> u32 {
    let v2: Dummy = Dummy { value: 1_u32 };
    v2.nonexistent = 2_u32;
    return v1;
}

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

fn foo (v1: u32) -> u32 {
    let v2: Dummy = Dummy { value: 1_u32 };
    v1.value = 2_u32;
    return v1;
}

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

fn foo (v1: u32) -> u32 {
    let v2: Dummy = Dummy { value: false };
    return v1;
}

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

fn foo (v1: u32) -> u32 {
    let v2: u32 = Nonexistent { value: false };
    return v1;
}

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

fn foo() -> u32 {
    loop {
        break 'nonexistent;
    }
    return 0_u32;
}

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

fn foo() -> u32 {
    'a: {
        continue 'a;
    }
    return 0_u32;
}