Test missing_dependent_where_clause
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_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()`"#]])
}
Rules proved (0)
This test records no positive coverage.
Premises failed (10)
The last column links to the premise’s page when the judgment view counts this failure against that premise. It does not when the premise is read as infallible, or when the failure was blamed inside a multi-line premise that carries no record on its own first line.
| Judgment | Rule | Premise | All tests of this premise |
|---|---|---|---|
| check_adt | check adt | scope(enter_universally(Env::default(), &adt.bin… (line 19, blamed at line 20) | not counted by the judgment view |
| check_all_crates | check all prefixes | for_all(i in 0..crates.len()) (let program = cra… (line 52, blamed at line 54) | not counted by the judgment view |
| check_crate | check crate | for_all(item in &c.items) (check_crate_item(prog… (line 73, blamed at line 74) | not counted by the judgment view |
| check_crate_item | adt | check_adt(program, &s.to_adt()) => () (line 201) | 3 tests |
| prove_after | prove_after | prove(decls, c1.env(), assumptions, goal) => c2 (line 19) | 21 tests |
| prove_predicate | assumption | prove_via(decls, env, assumptions, a, goal) => c (line 48) | 34 tests |
| prove_predicate | trait implied bound | ti in decls.trait_invariants() (line 106) | 19 tests |
| prove_predicate | trait well formed | for_all(decls, env, assumptions, &trait_ref.para… (line 127) | 1 test |
| prove_predicate_list | some | prove_predicate(decls, env, assumptions, wc0) =>… (line 26) | 67 tests |
| prove_wf | ADT | prove_after(decls, c, assumptions, &t.where_clau… (line 64) | 5 tests |
Proof trees
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:74check_crate_item failedmod.rs:179rule "adt"mod.rs:201check_adt failedadts.rs:11args
rule "check adt"adts.rs:20prove failedfunction.rs:250args
rulefunction.rs:250prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "trait well formed"prove_predicate.rs:127prove_wf failedprove_wf.rs:11args
rule "ADT"prove_wf.rs:64prove_after failedprove_after.rs:8args
rule "prove_after"prove_after.rs:19prove failedprove_after.rs:19args
ruleprove_after.rs:19prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "trait implied bound"prove_predicate.rs:106 (failed: empty_collection)