Test dangling
Source location: tests/borrowck.rs:2726
fn dangling<'a>(x: u32) -> &'a 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.
| Judgment | Rule | Premise | All tests of this premise |
|---|---|---|---|
| borrow_check | borrow_check | borrow_check_block(env, assumptions, state, bloc… (line 135) | 113 tests |
| borrow_check_block | basic block | for_all(i in 0..stmts.len()) with(env, state) (b… (line 158, blamed at line 159) | not counted by the judgment view |
| borrow_check_statement | return | drop_places(env, assumptions, state, locals_to_d… (line 288) | 2 tests |
| borrow_check_statement | exists | scope(env.enter_existentially(&with_variables(bi… (line 304, blamed at line 306) | not counted by the judgment view |
| borrow_check_statement | exists | scope(env.enter_existentially(&with_variables(bi… (line 314, blamed at line 316) | not counted by the judgment view |
| borrow_check_statement | exists | scope(env.enter_existentially(&with_variables(bi… (line 328, blamed at line 331) | not counted by the judgment view |
| drop_places | drop_places | for_all(place in places) with(state) (access_per… (line 891, blamed at line 892) | not counted by the judgment view |
| access_permitted_by_loans | access_permitted_by_loans | for_all(loan in &state.current.loans_live) with(… (line 935, blamed at line 936) | not counted by the judgment view |
| access_permitted_by_loan | borrow of disjoint places | if place_disjoint_from_place(&loan.place, &acces… (line 958) | 45 tests |
| access_permitted_by_loan | write-indirect | if let TypedPlaceExpressionData::Deref(place_loa… (line 985) | 37 tests |
| access_permitted_by_loan | loan is dead | loan_cannot_outlive_universal_regions(env, assum… (line 1006) | 4 tests |
| loan_cannot_outlive_universal_regions | loan_not_required_by_universal_regions | if outlived_by_loan.iter().all(|p| match p { // … (line 1327) | 10 tests |
| check_free_fn | check free fn | check_fn(program, Env::default(), Predicates::t(… (line 24) | 116 tests |
| check_fn | check fn | scope(enter_universally(env, &f.binder) => (env,… (line 48, blamed at line 54) | not counted by the judgment view |
| check_fn_body | expr fn body | borrow_check(typeck_env, assumptions, initial_st… (line 89) | 114 tests |
| check_all_crates | check all prefixes | for_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54) | not counted by the judgment view |
| check_crate | check crate | for_all(item in &c.items) (check_crate_item(prog… (line 74, blamed at line 75) | not counted by the judgment view |
| check_crate_item | free fn | check_free_fn(program, f, crate_id) => () (line 208) | 116 tests |
Proof trees
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180rule "free fn"mod.rs:208check_free_fn failedfns.rs:14args
rule "check free fn"fns.rs:24check_fn failedfns.rs:31args
rule "check fn"fns.rs:54check_fn_body failedfns.rs:61args
rule "expr fn body"fns.rs:89borrow_check failednll.rs:124args
rule "borrow_check"nll.rs:135borrow_check_block failednll.rs:144rule "basic block"nll.rs:159borrow_check_statement failednll.rs:176args
rule "exists"nll.rs:306borrow_check_block failednll.rs:144args
rule "basic block"nll.rs:159borrow_check_statement failednll.rs:176args
rule "return"nll.rs:288drop_places failednll.rs:878args
rule "drop_places"nll.rs:892access_permitted_by_loans failednll.rs:923args
rule "access_permitted_by_loans"nll.rs:936access_permitted_by_loan failednll.rs:943args
rule "borrow of disjoint places"nll.rs:958 (failed: if_false)rule "loan is dead"nll.rs:1006loan_cannot_outlive_universal_regions failednll.rs:1300args
rule "loan_not_required_by_universal_regions"nll.rs:1327 (failed: if_false)
rule "write-indirect"nll.rs:985 (failed: if_let)