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: borrow_check_expr / call / premise prove_where_clauses(env, assumptions, state, where_clauses) => state

Premise at line 445. Observed failure causes: failed_judgment.

call
LineCoverageSource
4203(borrow_check_expr(
env,
assumptions,
state,
callee,
args.live_before(env, &state, places_live),
) => (callee_ty, state))
429(prove_ty_is_rigid(env, assumptions, state, callee_ty) => (RigidTy { name: RigidName::FnDef(fn_id), parameters }, state))
432(let Fn { id: _, safety, binder } = env.crates().fn_named(fn_id)?)
434(ProvenSet::singleton((safety, ProofTree::leaf("safety"))) => Safety::Safe)
435(let FnBoundData { input_args, output_ty, where_clauses, body: _ } =
binder.instantiate_with(parameters)?)
439N/A(let input_tys: Vec<Ty> = input_args.iter().map(|a| a.ty.clone()).collect())
4401(if input_tys.len() == args.len())
442(for_all(i in 0..args.len()) with(state)
(borrow_check_expr_has_ty(env, assumptions, state, &args[i], &input_tys[i], places_live) => state))
4452(prove_where_clauses(env, assumptions, state, where_clauses) => state)
──────── ("call")
44725(borrow_check_expr(env, assumptions, state, Expr::Call { callee, args }, places_live) => (output_ty, state))

2 tests failed proving this premise:


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;
    }
}
Failed proof tree