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

Negative coverage: check_adt / check adt / premise prove_where_clauses_well_formed(program, env, where_clauses, where_clauses) => ()

Premise at line 21. Observed failure causes: failed_judgment.

check adt
LineCoverageSource
182(check_adt_variant_names_unique(adt) => ())
19N/A(let (env, bound_data) = Env::default().instantiate_universally(&adt.binder))
20N/A(let AdtBoundData { where_clauses, variants } = bound_data)
211(prove_where_clauses_well_formed(program, env, where_clauses, where_clauses) => ())
22(for_all(variant in variants)
(let Variant { fields, .. } = variant)
(for_all(field in fields)
(let Field { ty, .. } = field)
(prove_goal(program, env, where_clauses, Relation::well_formed(ty)) => ())))
──────── ("check adt")
2831(check_adt(program, adt) => ())

1 test failed proving this premise:


Source location: tests/well_formed_trait_ref.rs:37

#[test]
fn missing_dependent_where_clause() {
    FormalityTest::new(crates![crate foo {
        trait Trait1 {}

        trait Trait2 {}

        struct S1<T> where T: Trait1 {
            dummy: T,
        }

        struct S2<T> where S1<T> : Trait2 {
            dummy: T,
        }
    }])
    .err(expect_test::expect![[r#"
        crates/formality-rust/src/prove/prove/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ WellFormedTraitRef(Trait2(S1<!ty_0>)), via: Trait2(S1<!ty_0>), assumptions: {Trait2(S1<!ty_0>)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }

        crates/formality-rust/src/prove/prove/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Trait1(!ty_0), via: Trait2(S1<!ty_0>), assumptions: {Trait2(S1<!ty_0>)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }

        the rule "trait implied bound" at (prove_wc.rs) failed because
          expression evaluated to an empty collection: `decls.trait_invariants()`"#]])
}
Failed proof tree