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 overlap_check_impl

judgment_fn! {
    /// Holds if `impl_a` and `impl_b` cannot apply to the same types.
    /// Trivially holds for the same impl or for impls of different traits.
    fn overlap_check_impl(program: Program, impl_a: TraitImpl, impl_b: TraitImpl) => () {
        /* rules omitted */
    }
}

Source: crates/formality-rust/src/check/coherence.rs:64

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.

same impl
LineCoverageSource
729(if impl_a == impl_b)
──────── ("same impl")
74210(overlap_check_impl(_program, impl_a, impl_b) => ())
different trait
LineCoverageSource
799(if impl_a.trait_id() != impl_b.trait_id())
──────── ("different trait")
81194(overlap_check_impl(_program, impl_a, impl_b) => ())
not goal
LineCoverageSource
102✗(if impl_a != impl_b)
103✗(if impl_a.trait_id() == impl_b.trait_id())
104✗(scope(enter_universally(Env::default(), &impl_a.binder) => (env, a)) with()
(scope(enter_universally(env, &impl_b.binder) => (env, b)) with()
(prove_not_goal(program, env, (), (Predicates::all_eq(&a.trait_ref().parameters, &b.trait_ref().parameters), &a.where_clauses, &b.where_clauses)) => ())))
──────── ("not goal")
108195(overlap_check_impl(program, impl_a, impl_b) => ())
inverted
LineCoverageSource
114✗(if impl_a != impl_b)
115✗(if impl_a.trait_id() == impl_b.trait_id())
116✗(scope(enter_universally(Env::default(), &impl_a.binder) => (env, a)) with()
(scope(enter_universally(env, &impl_b.binder) => (env, b)) with()
(wc in a.where_clauses.iter().chain(&b.where_clauses).flat_map(|wc| wc.invert()))
(prove_goal(program, env, (Predicates::all_eq(&a.trait_ref().parameters, &b.trait_ref().parameters), &a.where_clauses, &b.where_clauses), wc) => ())))
──────── ("inverted")
1211(overlap_check_impl(program, impl_a, impl_b) => ())

How to read this page