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_statement / return / premise prove_assignable(env, assumptions, state, expr_ty, output_ty) => state

Premise at line 281. Observed failure causes: failed_judgment.

return
LineCoverageSource
2793(borrow_check_expr(env, assumptions, state, expr, LivePlaces::default()) => (expr_ty, state))
280(if let Some(output_ty) = &env.output_ty)
2814(prove_assignable(env, assumptions, state, expr_ty, output_ty) => state)
282N/A(let state = state.diverges())
──────── ("return")
28449(borrow_check_statement(env, assumptions, state, Stmt::Return { expr }, _places_live_on_exit) => (env, state))

4 tests failed proving this premise:


Source location: tests/borrowck.rs:2170

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

Source location: tests/borrowck.rs:2249

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

Source location: tests/mir_typeck.rs:147

fn foo (b: bool) -> u32 {
    if b {
        return 1 _ u32;
    } else {
        return false;
    }
}
Failed proof tree

Source location: tests/mir_typeck.rs:421

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