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: prove_predicate / trait well formed / premise for_all(decls, env, assumptions, &trait_ref.parameters, &prove_wf) => c

Premise at line 127. Observed failure causes: failed_judgment.

trait well formed
LineCoverageSource
1271(for_all(decls, env, assumptions, &trait_ref.parameters, &prove_wf) => c)
128N/A(let t = decls.trait_decl(&trait_ref.trait_id))
129N/A(let t = t.binder.instantiate_with(&trait_ref.parameters).unwrap())
1302(prove_after(decls, c, assumptions, &t.where_clause) => c)
──────── ("trait well formed")
13230(prove_predicate(decls, env, assumptions, AtomicPredicate::WellFormedTraitRef(trait_ref)) => c)

1 test failed proving this premise:


Source location: tests/well_formed_trait_ref.rs:37 (all coverage from this test)

#[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_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_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_predicate.rs) failed because
          expression evaluated to an empty collection: `decls.trait_invariants()`"#]])
}
Failed proof tree

How to read this page