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

Judgment can_outlive

judgment_fn! {
    /// Check if lt_a can outlive param_b.
    /// For non-universal targets, trivially succeeds.
    /// For universal lifetime targets, must prove from assumptions.
    fn can_outlive(
        env: TypeckEnv,
        assumptions: Predicates,
        outlives: Set<PendingOutlives>,
        param_a: Parameter,
        param_b: Parameter,
    ) => () {
        /* rules omitted */
    }
}

Source: crates/formality-rust/src/check/borrow_check/outlives.rs:56

The number on each rule’s conclusion is positive coverage; the number on each premise is negative coverage. Click a number to browse the tests.

existential target
LineCoverageSource
73✗(if var_b.is_existential())
──────── ("existential target")
7520(can_outlive(_env, _assumptions, _outlives, _param_a, var_b: Variable) => ())
universal target
LineCoverageSource
80✗(if var_b.is_universal())
818(prove(&env.program, &env.env, assumptions, AtomicPredicate::outlives(param_a, var_b)) => c)
82✗(if c.unconditionally_true())
──────── ("universal target")
843(can_outlive(env, assumptions, _outlives, param_a, var_b: Variable) => ())

How to read this page