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

Test dangling

Source location: tests/borrowck.rs:2681

fn dangling<'a>() -> &'a u32 {
    let x: u32 = 22_u32;
    exists<'r0> {
        return &'r0 x;
    }
}

Rules proved (0)

This test records no positive coverage.

Premises failed (18)

The last column links to the premise’s page when the judgment view counts this failure against that premise. It does not when the premise is read as infallible, or when the failure was blamed inside a multi-line premise that carries no record on its own first line.

JudgmentRulePremiseAll tests of this premise
borrow_checkborrow_checkborrow_check_block(env, assumptions, state, bloc… (line 135)113 tests
borrow_check_blockbasic blockfor_all(i in 0..stmts.len()) with(env, state) (b… (line 158, blamed at line 159)not counted by the judgment view
borrow_check_statementreturndrop_places(env, assumptions, state, locals_to_d… (line 288)2 tests
borrow_check_statementexistsscope(env.enter_existentially(&with_variables(bi… (line 304, blamed at line 306)not counted by the judgment view
borrow_check_statementexistsscope(env.enter_existentially(&with_variables(bi… (line 314, blamed at line 316)not counted by the judgment view
borrow_check_statementexistsscope(env.enter_existentially(&with_variables(bi… (line 328, blamed at line 331)not counted by the judgment view
drop_placesdrop_placesfor_all(place in places) with(state) (access_per… (line 891, blamed at line 892)not counted by the judgment view
access_permitted_by_loansaccess_permitted_by_loansfor_all(loan in &state.current.loans_live) with(… (line 935, blamed at line 936)not counted by the judgment view
access_permitted_by_loanborrow of disjoint placesif place_disjoint_from_place(&loan.place, &acces… (line 958)45 tests
access_permitted_by_loanwrite-indirectif let TypedPlaceExpressionData::Deref(place_loa… (line 985)37 tests
access_permitted_by_loanloan is deadloan_cannot_outlive_universal_regions(env, assum… (line 1006)4 tests
loan_cannot_outlive_universal_regionsloan_not_required_by_universal_regionsif outlived_by_loan.iter().all(|p| match p { // … (line 1327)10 tests
check_free_fncheck free fncheck_fn(program, Env::default(), Predicates::t(… (line 24)116 tests
check_fncheck fnscope(enter_universally(env, &f.binder) => (env,… (line 48, blamed at line 54)not counted by the judgment view
check_fn_bodyexpr fn bodyborrow_check(typeck_env, assumptions, initial_st… (line 89)114 tests
check_all_cratescheck all prefixesfor_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54)not counted by the judgment view
check_cratecheck cratefor_all(item in &c.items) (check_crate_item(prog… (line 74, blamed at line 75)not counted by the judgment view
check_crate_itemfree fncheck_free_fn(program, f, crate_id) => () (line 208)116 tests

Proof trees

Failed proof tree

How to read this page