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

Positive coverage: can_outlive / universal target

universal target
LineCoverageSource
80(if var_b.is_universal())
8110(prove(&env.program, &env.env, assumptions, Relation::outlives(param_a, var_b)) => c)
82(if c.unconditionally_true())
──────── ("universal target")
842(can_outlive(env, assumptions, _outlives, param_a, var_b: Variable) => ())

2 tests exercised this rule:


Source location: tests/borrowck.rs:3540

fn foo<'a, 'b>(p: &'a mut u32) -> u32 where 'a: 'b {
    let q: &'b mut u32 = &mut 'b *p;
    q;
    return 0 _ u32;
}
Proof tree
… (200 of 1154 nodes shown)

Source location: tests/borrowck.rs:4719

#[test]
fn flow_sensitive_invariance_same_region() {
    // [nll]: rustc passes.
    FormalityTest::new(feature_gate_program(
        NLL_GATE,
        FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
    ))
    .skip_execute()
    .ok();

    // [polonius]: rustc passes.
    FormalityTest::new(feature_gate_program(
        POLONIUS_ALPHA_GATE,
        FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
    ))
    .skip_execute()
    .ok();

    // [legacy]: rustc passes.
    FormalityTest::new(feature_gate_program(
        POLONIUS_UNLOCKED_GATE,
        FLOW_SENSITIVE_INVARIANCE_SAME_REGION,
    ))
    .skip_execute()
    .ok();
}
Proof tree
… (200 of 1218 nodes shown)