Negative coverage: prove_predicate_list / some / premise prove_predicate(decls, env, assumptions, wc0) => c
Premise at line 26. Observed failure causes: failed_judgment.
some| Line | Coverage | Source |
|---|---|---|
| 26 | 67 | (prove_predicate(decls, env, assumptions, wc0) => c) |
| 27 | 2 | (prove_after(decls, c, assumptions, wcs1) => c) |
| ──────── ("some") | ||
| 29 | 237 | (prove_predicate_list(decls, env, assumptions, Cons(wc0, wcs1)) => c) |
67 tests failed proving this premise:
Source location: crates/formality-rust/src/prove/test/adt_wf.rs:44 (all coverage from this test)
#[test]
fn not_well_formed_adt() {
let assumptions: Predicates = Predicates::t();
let goal: Parameter = term("X<u64>");
prove(
decls(),
Env::default(),
assumptions,
AtomicPredicate::WellFormed(goal),
)
.assert_err(expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: u64 = u32, via: Foo(u64), assumptions: {Foo(u64)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u64, via: Foo(u64), assumptions: {Foo(u64)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Foo(u64), assumptions: {Foo(u64)}, env: Env { variables: [], 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
prove failedadt_wf.rs:38args
ruleadt_wf.rs:38prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "parameter well formed"prove_predicate.rs:149prove_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 "positive impl"prove_predicate.rs:71prove failedprove_predicate.rs:71args
ruleprove_predicate.rs:71prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "trait implied bound"prove_predicate.rs:106 (failed: empty_collection)
Source location: crates/formality-rust/src/prove/test/eq_assumptions.rs:41 (all coverage from this test)
#[test]
fn test_normalize_assoc_ty_existential0() {
test_prove(
Program::empty(),
term("exists<A> {} => {for<T> if { <T as Iterator>::Item = u32 } <A as Iterator>::Item = u32}"),
).assert_err(
expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: <?ty_0 as Iterator>::Item = u32, via: <!ty_1 as Iterator>::Item = u32, assumptions: {<!ty_1 as Iterator>::Item = u32}, env: Env { variables: [?ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_1)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_1)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "normalize-via-impl" at (prove_normalize.rs) failed because
expression evaluated to an empty collection: `decls.alias_eq_decls(&a.name)`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: <!ty_0 as Iterator>::Item = <?ty_1 as Iterator>::Item, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !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: !ty_0 = ?ty_1, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: ?ty_1, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !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: u32 = <?ty_1 as Iterator>::Item, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "normalize-via-impl" at (prove_normalize.rs) failed because
expression evaluated to an empty collection: `decls.alias_eq_decls(&a.name)`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ?ty_1 = !ty_0, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: ?ty_1, via: <!ty_0 as Iterator>::Item = u32, assumptions: {<!ty_0 as Iterator>::Item = u32}, env: Env { variables: [?ty_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_0)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
the rule "normalize-via-impl" at (prove_normalize.rs) failed because
expression evaluated to an empty collection: `decls.alias_eq_decls(&a.name)`"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "implies"prove_predicate.rs:41prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "axiom-l"prove_normalize.rs:96prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "normalize-via-impl"prove_normalize.rs:42 (failed: empty_collection)
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:69prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "alias"prove_eq.rs:56prove failedprove_eq.rs:56args
ruleprove_eq.rs:56prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "existential"prove_eq.rs:62prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "normalize-l"prove_eq.rs:69prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "axiom-l"prove_normalize.rs:96prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "normalize-via-impl"prove_normalize.rs:42 (failed: empty_collection)
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "alias"prove_eq.rs:56prove failedprove_eq.rs:56args
ruleprove_eq.rs:56prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "existential"prove_eq.rs:62prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "axiom-l"prove_normalize.rs:96prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "symmetric"prove_normalize.rs:143prove_syntactically_eq failedprove_normalize.rs:130args
rule "alias"prove_normalize.rs:161prove_syntactically_eq failedprove_normalize.rs:130args
rule "existential-nonvar"prove_normalize.rs:167prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:94 (failed: if_let)rule "existential-universal"prove_eq.rs:140 (failed: if_false)
rule "normalize-via-impl"prove_normalize.rs:42 (failed: empty_collection)
Source location: crates/formality-rust/src/prove/test/eq_partial_eq.rs:33 (all coverage from this test)
#[test]
fn not_partial_eq_implies_eq() {
let goal: Predicate = term("for<T> if {PartialEq(T)} Eq(T)");
prove(decls(), (), (), goal)
.assert_err(
expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Eq(!ty_1), via: PartialEq(!ty_1), assumptions: {PartialEq(!ty_1)}, env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Eq(!ty_1), via: PartialEq(?ty_2), assumptions: {PartialEq(!ty_1)}, env: Env { variables: [!ty_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedeq_partial_eq.rs:32args
ruleeq_partial_eq.rs:32prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "implies"prove_predicate.rs:41prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "trait implied bound"prove_predicate.rs:108prove_via failedprove_via.rs:9args
Source location: crates/formality-rust/src/prove/test/eq_partial_eq.rs:44 (all coverage from this test)
#[test]
fn universals_not_eq() {
let goal: Predicate = term("for<T, U> if {Eq(T)} PartialEq(U)");
prove(decls(), (), (), goal)
.assert_err(
expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: PartialEq(!ty_2), via: Eq(!ty_1), assumptions: {Eq(!ty_1)}, env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = !ty_1, via: Eq(!ty_0), assumptions: {Eq(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Eq(!ty_0), assumptions: {Eq(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_1, via: Eq(!ty_0), assumptions: {Eq(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Eq(!ty_1), via: PartialEq(?ty_2), assumptions: {Eq(!ty_0)}, env: Env { variables: [!ty_0, !ty_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedeq_partial_eq.rs:43args
ruleeq_partial_eq.rs:43prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "implies"prove_predicate.rs:41prove_predicate failedprove_predicate.rs:22args
rule "assumption"prove_predicate.rs:48prove_via failedprove_via.rs:9args
rule "trait implied bound"prove_predicate.rs:109prove_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 "predicate-congruence-axiom"prove_via.rs:32prove failedprove_via.rs:32args
ruleprove_via.rs:32prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "trait implied bound"prove_predicate.rs:108prove_via failedprove_via.rs:9args
Source location: crates/formality-rust/src/prove/test/is_local.rs:11 (all coverage from this test)
#[test]
fn test_forall_not_local() {
test_prove(Program::empty(), term("{} => {for<T> @IsLocal(Debug(T))}")).assert_err(expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_1, assumptions: {}, env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([], 222)
&goal.trait_id = Debug"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "trait ref is local"prove_predicate.rs:136is_local_trait_ref failedis_local.rs:206args
rule "local parameter"is_local.rs:224is_local_parameter failedis_local.rs:293args
rule "local parameter"is_local.rs:305prove_normalize failedprove_normalize.rs:22args
rule "local trait"is_local.rs:216 (failed: if_false)
Source location: crates/formality-rust/src/prove/test/magic_copy.rs:25 (all coverage from this test)
#[test]
fn all_t_not_magic() {
test_prove(decls(), term("{} => {for<T> Magic(T)}")).assert_err(
expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = u32, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Copy(!ty_0), assumptions: {Copy(!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: Magic(!ty_0), via: Copy(?ty_1), assumptions: {}, env: Env { variables: [!ty_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Magic(!ty_1), via: Copy(?ty_2), assumptions: {}, env: Env { variables: [!ty_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "positive impl"prove_predicate.rs:78prove_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 "positive impl"prove_predicate.rs:71prove failedprove_predicate.rs:71args
ruleprove_predicate.rs:71prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "trait implied bound"prove_predicate.rs:109prove_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 "trait implied bound"prove_predicate.rs:108prove_via failedprove_via.rs:9args
rule "trait implied bound"prove_predicate.rs:108prove_via failedprove_via.rs:9args
Source location: crates/formality-rust/src/prove/test/magic_copy.rs:40 (all coverage from this test)
#[test]
fn all_t_not_copy() {
test_prove(decls(), term("{} => {for<T> Copy(T)}")).assert_err(
expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = u32, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Copy(!ty_0), assumptions: {Copy(!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: !ty_0 = u32, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Copy(!ty_0), assumptions: {Copy(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Copy(!ty_0), assumptions: {Copy(!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: Magic(!ty_0), via: Copy(?ty_1), assumptions: {}, env: Env { variables: [!ty_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "forall"prove_predicate.rs:35prove_predicate failedprove_predicate.rs:22args
rule "positive impl"prove_predicate.rs:71prove failedprove_predicate.rs:71args
ruleprove_predicate.rs:71prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "trait implied bound"prove_predicate.rs:109prove_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 "positive impl"prove_predicate.rs:78prove_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 "positive impl"prove_predicate.rs:71prove failedprove_predicate.rs:71args
ruleprove_predicate.rs:71prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "normalize-via-assumption"prove_normalize.rs:36prove_normalize_via failedprove_normalize.rs:55args
rule "trait implied bound"prove_predicate.rs:108prove_via failedprove_via.rs:9args
Source location: crates/formality-rust/src/prove/test/occurs_check.rs:24 (all coverage from this test)
#[test]
fn direct_cycle() {
test_prove(decls(), term("exists<A> {} => {A = Vec<A>}")).assert_err(expect![[r#"
failed at (proven_set.rs) because
`?ty_0` occurs in `Vec<?ty_0>`
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ?ty_0, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: Vec<?ty_0>, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:26prove_predicate failedprove_predicate.rs:22args
rule "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "existential"prove_eq.rs:62prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:95equate_variable failedprove_eq.rs:95ruleproven_set.rs:59 (failed: inapplicable)
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
Source location: crates/formality-rust/src/prove/test/occurs_check.rs:48 (all coverage from this test)
#[test]
fn indirect_cycle_1() {
test_prove(decls(), term("exists<A, B> {} => {A = Vec<B>, B = A}")).assert_err(expect![[r#"
failed at (proven_set.rs) because
`?ty_0` occurs in `Vec<?ty_0>`
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ?ty_0, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: Vec<?ty_0>, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:27prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "existential"prove_eq.rs:62prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:95equate_variable failedprove_eq.rs:95ruleproven_set.rs:59 (failed: inapplicable)
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
Source location: crates/formality-rust/src/prove/test/occurs_check.rs:60 (all coverage from this test)
#[test]
fn indirect_cycle_2() {
test_prove(decls(), term("exists<A, B> {} => {B = A, A = Vec<B>}")).assert_err(expect![[r#"
failed at (proven_set.rs) because
`?ty_0` occurs in `Vec<?ty_0>`
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ?ty_0, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: Vec<?ty_0>, assumptions: {}, env: Env { variables: [?ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Failed proof tree
prove failedtest_util.rs:57args
ruletest_util.rs:57prove_predicate_list failedprove_predicate_list.rs:8args
rule "some"prove_predicate_list.rs:27prove_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 "eq"prove_predicate.rs:115prove_eq failedprove_eq.rs:23args
rule "existential"prove_eq.rs:62prove_existential_var_eq failedprove_eq.rs:76args
rule "existential-nonvar"prove_eq.rs:95equate_variable failedprove_eq.rs:95ruleproven_set.rs:59 (failed: inapplicable)
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
rule "symmetric"prove_eq.rs:38prove_eq failedprove_eq.rs:23args
rule "normalize-l"prove_eq.rs:68prove_normalize failedprove_normalize.rs:22args
Source location: crates/formality-rust/src/prove/test/universes.rs:14 (all coverage from this test)
#[test]
fn exists_u_for_t() {
let decls = Program::empty();
test_prove(decls, term("exists<U> {} => {for<T> T = U}")).assert_err(expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_1, assumptions: {}, env: Env { variables: [?ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "existential-nonvar" at (prove_eq.rs) failed because
pattern `None` did not match value `Some(!ty_1)`
the rule "existential-universal" at (prove_eq.rs) failed because
condition evaluated to false: `env.universe(p) < env.universe(v)`
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ?ty_0, assumptions: {}, env: Env { variables: [?ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
Proof trees omitted for the remaining 57 tests; each one is on its test’s page in Coverage by test.
Source location: tests/basic_tests.rs:34 (all coverage from this test)
#[test]
fn hello_world_fail() {
FormalityTest::new(crates![crate Foo {
trait Foo<T> where T: Bar<Self> {}
trait Bar<T> where T: Baz {}
trait Baz {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ WellFormedTraitRef(Bar(!ty_0, !ty_1)), via: Bar(!ty_0, !ty_1), assumptions: {Bar(!ty_0, !ty_1)}, env: Env { variables: [!ty_1, !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: Baz(!ty_1), via: Bar(!ty_0, !ty_1), assumptions: {Bar(!ty_0, !ty_1)}, env: Env { variables: [!ty_1, !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()`"#]])
}
Source location: tests/basic_tests.rs:85 (all coverage from this test)
#[test]
fn basic_where_clauses_fail() {
FormalityTest::new(crates![crate core {
#![feature(non_lifetime_binders)]
trait A<T> where T: B { }
trait B { }
trait WellFormed where for<T> u32: A<T> { }
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ WellFormedTraitRef(A(u32, !ty_1)), via: A(u32, ?ty_2), assumptions: {for <ty> A(u32, ^ty0_0)}, env: Env { variables: [!ty_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: B(!ty_0), via: A(u32, ?ty_1), assumptions: {for <ty> A(u32, ^ty0_0)}, env: Env { variables: [!ty_0, ?ty_1], 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()`"#]])
}
Source location: tests/borrowck.rs:721 (all coverage from this test)
fn foo() -> Datum {
exists<'r0, 'r1> {
let x: Datum = Datum { value: 0_u32 };
let r: &'r0 Datum = &'r1 x;
let y: Datum = *r;
return y;
}
}
Source location: tests/borrowck.rs:1476 (all coverage from this test)
fn foo() -> Datum {
exists<'r0, 'r1> {
let x: Datum = Datum { value: 0_u32 };
let r: &'r0 mut Datum = &'r1 mut x;
let y: Datum = *r;
return y;
}
}
Source location: tests/borrowck.rs:2704 (all coverage from this test)
fn foo<'a, 'b>(v1: &'a u32) -> &'b u32 {
exists<'r0> {
let v2: &'r0 u32 = v1;
return v2;
}
}
Source location: tests/borrowck.rs:2734 (all coverage from this test)
fn foo<'a, 'b>(v1: &'a u32, v2: &'b u32) -> () {
let output: &'b u32 = v2;
loop {
output = v1;
}
}
Source location: tests/borrowck.rs:2799 (all coverage from this test)
fn foo<'a, 'b, 'c>(v1: &'a u32) -> &'c u32
where
'a: 'b,
{
return v1;
}
Source location: tests/borrowck.rs:3470 (all coverage from this test)
fn foo<'a, 'b>(a: &'a u32) -> &'b u32 {
let r: &'b u32 = identity::<&'b u32>(a);
return r;
}
Source location: tests/borrowck.rs:3891 (all coverage from this test)
fn foo(f: Pair) -> () {
let s: Datum = f.x;
}
Source location: tests/borrowck.rs:4035 (all coverage from this test)
fn foo<'a, 'b>(p: &'a mut u32) -> u32 {
let q: &'b mut u32 = &'b mut *p;
q;
return 0_u32;
}
Source location: tests/borrowck.rs:4831 (all coverage from this test)
fn use_it<'a, 'b>() -> u32 {
exists<'r0> {
let v: Invariant<'r0> = create_invariant::<'r0>();
if true {
return sink::<'a, 'r0>(v);
} else {
return sink::<'b, 'r0>(v);
}
}
}
Source location: tests/borrowck.rs:4862 (all coverage from this test)
fn use_both<'a, 'b>() -> u32 {
exists<'r0> {
let v: Invariant<'r0> = create_invariant::<'r0>();
let w: Invariant<'r0> = create_invariant::<'r0>();
sink::<'a, 'r0>(v);
sink::<'b, 'r0>(w);
return 0_u32;
}
}
Source location: tests/coherence_orphan.rs:13 (all coverage from this test)
#[test]
fn neg_CoreTrait_for_CoreStruct_in_Foo() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
#![feature(negative_impls)]
impl !CoreTrait for CoreStruct {}
}]).err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
a = CoreStruct
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { #![feature(negative_impls)] impl ! CoreTrait for CoreStruct {} }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:48 (all coverage from this test)
#[test]
fn mirror_CoreStruct() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
trait Mirror {
type Assoc : [];
}
impl<T> Mirror for T {
type Assoc = T;
}
},
crate foo {
impl CoreTrait for <CoreStruct as Mirror>::Assoc {}
}]).err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } trait Mirror <ty> { type Assoc : [] ; } impl <ty> Mirror for ^ty0_0 { type Assoc = ^ty1_0 ; } }, crate foo { impl CoreTrait for <CoreStruct as Mirror>::Assoc { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } trait Mirror <ty> { type Assoc : [] ; } impl <ty> Mirror for ^ty0_0 { type Assoc = ^ty1_0 ; } }, crate foo { impl CoreTrait for <CoreStruct as Mirror>::Assoc { } }], 222)
a = CoreStruct
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } trait Mirror <ty> { type Assoc : [] ; } impl <ty> Mirror for ^ty0_0 { type Assoc = ^ty1_0 ; } }, crate foo { impl CoreTrait for <CoreStruct as Mirror>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:141 (all coverage from this test)
#[test]
fn uncovered_mut_ref_T() {
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a mut T where T: 'a {}
}])
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 mut !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(mut)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 mut !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:172 (all coverage from this test)
#[test]
fn uncovered_nested_ref_T() {
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<'a, T> CoreTrait<FooStruct> for &'a &'a T where T: 'a {}
}])
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: @ IsLocal(CoreTrait(&!lt_1 &!lt_1 !ty_0, FooStruct)), via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &!lt_1 &!lt_1 !ty_0, via: !ty_0 : !lt_1, assumptions: {!ty_0 : !lt_1}, env: Env { variables: [!lt_1, !ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <lt, ty> CoreTrait <FooStruct> for &^lt0_0 &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:213 (all coverage from this test)
#[test]
fn raw_pointer_is_not_fundamental() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
},
crate foo {
struct FooStruct {}
impl CoreTrait for *mut FooStruct {}
}])
.skip_execute()
.err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
name = * mut
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: *mut FooStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } }, crate foo { struct FooStruct { } impl CoreTrait for *mut FooStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:235 (all coverage from this test)
#[test]
fn uncovered_T() {
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:254 (all coverage from this test)
#[test]
fn uncovered_ref_T() {
FormalityTest::new(crates![crate core {
trait CoreTrait<T> {}
},
crate foo {
struct FooStruct {}
impl<T> CoreTrait<FooStruct> for &'static T {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "rigid" at (is_local.rs) failed because
condition evaluated to false: `!is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
name = &(shared)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static !ty_0, assumptions: {}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty, ty> { } }, crate foo { struct FooStruct { } impl <ty> CoreTrait <FooStruct> for &' static ^ty0_0 { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:329 (all coverage from this test)
#[test]
fn ref_foreign_wrapper_of_local_is_not_local() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct ForeignWrapper<T> { value: T }
},
crate foo {
struct FooStruct {}
impl<'a> CoreTrait for &'a ForeignWrapper<FooStruct> {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
5 | impl<'a00> CoreTrait for &'a00 ForeignWrapper<FooStruct> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
| |
| `mycore::ForeignWrapper` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
name = (adt ForeignWrapper)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
a = ForeignWrapper
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 ForeignWrapper<FooStruct>, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct ForeignWrapper <ty> { value : ^ty0_0 } }, crate foo { struct FooStruct { } impl <lt> CoreTrait for &^lt0_0 ForeignWrapper<FooStruct> { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:375 (all coverage from this test)
#[test]
fn ref_CoreStruct_is_not_local() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
impl CoreTrait for &'static CoreStruct {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> lib.rs
|
3 | impl CoreTrait for &'static CoreStruct {}
| ^^^^^^^^^^^^^^^^^^^-------------------
| |
| `mycore::CoreStruct` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead
For more information about this error, try `rustc --explain E0117`.
error: could not compile `foo` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for &' static CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for &' static CoreStruct { } }], 222)
a = CoreStruct
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &' static CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for &' static CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:412 (all coverage from this test)
#[test]
fn alias_to_unit() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
trait Unit {
type Assoc : [];
}
impl<T> Unit for T {
type Assoc = ();
}
},
crate foo {
struct FooStruct {}
impl CoreTrait for <FooStruct as Unit>::Assoc {}
}]).err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
name = tuple(0)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: (), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } trait Unit <ty> { type Assoc : [] ; } impl <ty> Unit for ^ty0_0 { type Assoc = () ; } }, crate foo { struct FooStruct { } impl CoreTrait for <FooStruct as Unit>::Assoc { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_orphan.rs:434 (all coverage from this test)
#[test]
fn CoreTrait_for_CoreStruct_in_Foo() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
impl CoreTrait for CoreStruct {}
}]).err(expect_test::expect![[r#"
the rule "fundamental rigid type" at (is_local.rs) failed because
condition evaluated to false: `is_fundamental(decls, name)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for CoreStruct { } }], 222)
name = (adt CoreStruct)
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: CoreStruct, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "local rigid type" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_adt_id(a)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for CoreStruct { } }], 222)
a = CoreStruct
the rule "local trait" at (is_local.rs) failed because
condition evaluated to false: `decls.is_local_trait_id(&goal.trait_id)`
decls = program([crate core { trait CoreTrait <ty> { } struct CoreStruct { } }, crate foo { impl CoreTrait for CoreStruct { } }], 222)
&goal.trait_id = CoreTrait"#]])
}
Source location: tests/coherence_overlap.rs:251 (all coverage from this test)
#[test]
fn foo_crate_cannot_assume_CoreStruct_does_not_impl_CoreTrait() {
FormalityTest::new(crates![crate core {
trait CoreTrait {}
struct CoreStruct {}
},
crate foo {
trait FooTrait {}
impl<T> FooTrait for T where T: CoreTrait {}
impl FooTrait for CoreStruct {}
}])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! CoreTrait(!ty_0), via: !ty_0 = CoreStruct, assumptions: {!ty_0 = CoreStruct, CoreTrait(!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: ! CoreTrait(!ty_0), via: CoreTrait(!ty_0), assumptions: {!ty_0 = CoreStruct, CoreTrait(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = CoreStruct, CoreTrait(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> FooTrait for ^ty0_0 where ^ty0_0 : CoreTrait { }
impl_b = impl FooTrait for CoreStruct { }"#]])
}
Source location: tests/coherence_overlap.rs:292 (all coverage from this test)
#[test]
fn u32_T_where_T_Is_impls() {
FormalityTest::new(crates![crate core {
trait Foo {}
impl Foo for u32 {}
impl<T> Foo for T where T: Is {}
trait Is {}
impl Is for u32 {}
}])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Is(!ty_0), via: Is(!ty_0), assumptions: {u32 = !ty_0, Is(!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: ! Is(!ty_0), via: u32 = !ty_0, assumptions: {u32 = !ty_0, Is(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {u32 = !ty_1, Is(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl Foo for u32 { }
impl_b = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Is { }"#]])
}
Source location: tests/coherence_overlap.rs:394 (all coverage from this test)
#[test]
fn T_where_Bar_and_ref_T() {
FormalityTest::new(crates![crate core {
trait Foo {}
trait Bar {}
impl<T> Foo for T where T: Bar {}
impl<T> Foo for &'static T {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `&'static _`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Bar {}
| ------------------------------------ first implementation here
6 |
7 | impl<T00> Foo for &'static T00 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&'static _`
|
= note: downstream crates may implement trait `Bar` for type `&'static _`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `mycore` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: !ty_0 = &' static !ty_1, assumptions: {!ty_0 = &' static !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: Bar(!ty_0), assumptions: {!ty_0 = &' static !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = &' static !ty_2, Bar(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Bar { }
impl_b = impl <ty> Foo for &' static ^ty0_0 { }"#]])
}
Source location: tests/coherence_overlap.rs:437 (all coverage from this test)
#[test]
fn T_where_Bar_and_mut_ref_T() {
FormalityTest::new(crates![crate core {
trait Foo {}
trait Bar {}
impl<T> Foo for T where T: Bar {}
impl<T> Foo for &'static mut T {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `&'static mut _`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Bar {}
| ------------------------------------ first implementation here
6 |
7 | impl<T00> Foo for &'static mut T00 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&'static mut _`
|
= note: downstream crates may implement trait `Bar` for type `&'static mut _`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `mycore` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: !ty_0 = &' static mut !ty_1, assumptions: {!ty_0 = &' static mut !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: Bar(!ty_0), assumptions: {!ty_0 = &' static mut !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = &' static mut !ty_2, Bar(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Bar { }
impl_b = impl <ty> Foo for &' static mut ^ty0_0 { }"#]])
}
Source location: tests/coherence_overlap.rs:480 (all coverage from this test)
#[test]
fn T_where_Bar_and_nested_ref_T() {
FormalityTest::new(crates![crate core {
trait Foo {}
trait Bar {}
impl<T> Foo for T where T: Bar {}
impl<T> Foo for &'static &'static T {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0119]: conflicting implementations of trait `Foo` for type `&'static &'static _`
--> lib.rs
|
5 | impl<T00> Foo for T00 where T00: Bar {}
| ------------------------------------ first implementation here
6 |
7 | impl<T00> Foo for &'static &'static T00 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&'static &'static _`
|
= note: downstream crates may implement trait `Bar` for type `&'static &'static _`
For more information about this error, try `rustc --explain E0119`.
error: could not compile `mycore` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: !ty_0 = &' static &' static !ty_1, assumptions: {!ty_0 = &' static &' static !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_0), via: Bar(!ty_0), assumptions: {!ty_0 = &' static &' static !ty_1, Bar(!ty_0)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = &' static &' static !ty_2, Bar(!ty_1)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Bar { }
impl_b = impl <ty> Foo for &' static &' static ^ty0_0 { }"#]])
}
Source location: tests/coherence_overlap.rs:511 (all coverage from this test)
#[test]
fn T_and_T_bar() {
FormalityTest::new(crates![crate core {
trait Foo { }
trait Bar { }
impl<T> Foo for T { }
impl<T> Foo for T where T: Bar { }
}])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_1), via: !ty_0 = !ty_1, assumptions: {!ty_0 = !ty_1, Bar(!ty_1)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(!ty_1), via: Bar(!ty_1), assumptions: {!ty_0 = !ty_1, Bar(!ty_1)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = !ty_2, Bar(!ty_2)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 { }
impl_b = impl <ty> Foo for ^ty0_0 where ^ty0_0 : Bar { }"#]])
}
Source location: tests/coherence_overlap.rs:544 (all coverage from this test)
#[test]
fn T_and_Local_Bar_T() {
FormalityTest::new(crates![crate core {
trait Foo { }
trait Bar<U> { }
impl<T> Foo for T { }
impl<T> Foo for T where LocalType: Bar<T> { }
struct LocalType { }
}])
.err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(LocalType, !ty_1), via: !ty_0 = !ty_1, assumptions: {!ty_0 = !ty_1, Bar(LocalType, !ty_1)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Bar(LocalType, !ty_1), via: Bar(LocalType, !ty_1), assumptions: {!ty_0 = !ty_1, Bar(LocalType, !ty_1)}, env: Env { variables: [!ty_0, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = !ty_2, Bar(LocalType, !ty_2)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty> Foo for ^ty0_0 { }
impl_b = impl <ty> Foo for ^ty0_0 where LocalType : Bar <^ty0_0> { }"#]])
}
Source location: tests/coherence_overlap.rs:613 (all coverage from this test)
#[test]
fn is_local_with_unconstrained_self_ty_blanket_impl() {
// TODO: this test should pass imho
FormalityTest::new(crates![crate core {
trait Project {
type Assoc: [];
}
impl<T> Project for T {
type Assoc = ();
}
trait Foo<U> { }
},
crate foo {
struct LocalType {}
impl Foo<LocalType> for () {}
trait Overlap<U> {}
impl<T, U> Overlap<U> for T
where
<T as Project>::Assoc: Foo<U> {}
impl<T> Overlap<LocalType> for T {}
}]).err(expect_test::expect![[r#"
the rule "different trait" at (coherence.rs) failed because
condition evaluated to false: `impl_a.trait_id() != impl_b.trait_id()`
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Foo(<!ty_0 as Project>::Assoc, !ty_2), via: !ty_0 = !ty_1, assumptions: {!ty_0 = !ty_1, !ty_2 = LocalType, Foo(<!ty_0 as Project>::Assoc, !ty_2)}, env: Env { variables: [!ty_0, !ty_2, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Foo(<!ty_0 as Project>::Assoc, !ty_2), via: !ty_2 = LocalType, assumptions: {!ty_0 = !ty_1, !ty_2 = LocalType, Foo(<!ty_0 as Project>::Assoc, !ty_2)}, env: Env { variables: [!ty_0, !ty_2, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: ! Foo(<!ty_0 as Project>::Assoc, !ty_2), via: Foo(<!ty_0 as Project>::Assoc, !ty_2), assumptions: {!ty_0 = !ty_1, !ty_2 = LocalType, Foo(<!ty_0 as Project>::Assoc, !ty_2)}, env: Env { variables: [!ty_0, !ty_2, !ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
the rule "negative impl" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.neg_impl_decls(&trait_ref.trait_id)`
the rule "not goal" at (coherence.rs) failed because
failed to prove {!ty_1 = !ty_3, !ty_2 = LocalType, Foo(<!ty_1 as Project>::Assoc, !ty_2)} given {}, got [Constraints { env: Env { variables: [!ty_1, !ty_2, !ty_3], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]
the rule "same impl" at (coherence.rs) failed because
condition evaluated to false: `impl_a == impl_b`
impl_a = impl <ty, ty> Overlap <^ty0_1> for ^ty0_0 where <^ty0_0 as Project>::Assoc : Foo <^ty0_1> { }
impl_b = impl <ty> Overlap <LocalType> for ^ty0_0 { }"#]])
}
Source location: tests/consts.rs:36 (all coverage from this test)
#[test]
fn mismatch() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool {}
impl Foo<u32(42)> for u32 {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: u32, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: bool, assumptions: {}, env: Env { variables: [], 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()`"#]])
}
Source location: tests/consts.rs:76 (all coverage from this test)
#[test]
fn generic_mismatch() {
FormalityTest::new(crates![crate Foo {
trait Foo<const C> where type_of_const C is bool {}
// Here, the impl is assuming C is u32, which mismatches the trait bound.
impl<const C> Foo<C> for u32 where type_of_const C is u32 {}
}]).err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: Foo(u32, !const_0), via: @ ConstHasType(!const_0 , u32), assumptions: {@ ConstHasType(!const_0 , u32)}, env: Env { variables: [!const_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: u32 = bool, via: @ ConstHasType(!const_0 , u32), assumptions: {@ ConstHasType(!const_0 , u32)}, env: Env { variables: [!const_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: @ ConstHasType(!const_0 , u32), assumptions: {@ ConstHasType(!const_0 , u32)}, env: Env { variables: [!const_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: bool, via: @ ConstHasType(!const_0 , u32), assumptions: {@ ConstHasType(!const_0 , u32)}, env: Env { variables: [!const_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_const_has_type.rs:11:1: no applicable rules for prove_const_has_type { constant: !const_0, assumptions: {@ ConstHasType(!const_0 , u32)}, env: Env { variables: [!const_0], bias: Soundness, pending: [], allow_pending_outlives: false }, decls: program([crate core { trait Copy <ty> { } impl Copy for () { } impl Copy for u8 { } impl Copy for u16 { } impl Copy for u32 { } impl Copy for u64 { } impl Copy for u128 { } impl Copy for i8 { } impl Copy for i16 { } impl Copy for i32 { } impl Copy for i64 { } impl Copy for i128 { } impl Copy for bool { } impl Copy for usize { } impl Copy for isize { } impl <lt, ty> Copy for &^lt0_0 ^ty0_1 { } trait Drop <ty> { fn drop <lt> (self : &^lt0_0 mut ^ty1_0) where ^ty1_0 : ^lt0_0 ; } trait Derefable <ty> { type Target : [] ; } impl <lt, ty> Derefable for &^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { type Target = ^ty1_1 ; } impl <lt, ty> Derefable for &^lt0_0 mut ^ty0_1 where ^ty0_1 : ^lt0_0 { type Target = ^ty1_1 ; } trait Sized <ty> { } impl Sized for () { } impl Sized for u8 { } impl Sized for u16 { } impl Sized for u32 { } impl Sized for u64 { } impl Sized for u128 { } impl Sized for i8 { } impl Sized for i16 { } impl Sized for i32 { } impl Sized for i64 { } impl Sized for i128 { } impl Sized for bool { } impl Sized for usize { } impl Sized for isize { } impl <lt, ty> Sized for &^lt0_0 ^ty0_1 { } impl <lt, ty> Sized for &^lt0_0 mut ^ty0_1 { } }, crate Foo { trait Foo <ty, const> where type_of_const ^const0_1 is bool { } impl <const> Foo <^const0_0> for u32 where type_of_const ^const0_0 is u32 { } }], 222) }
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]])
}
Source location: tests/drop.rs:83 (all coverage from this test)
Source location: tests/drop.rs:192 (all coverage from this test)
fn drop<'a>(self: &'a MyStruct) -> () {}
}
}])
rr(expect_test::expect![[r#"
r[E0053]: method `drop` has an incompatible type for trait
lib.rs
|
fn drop<'a10>(mut self: &'a10 MyStruct) -> () {}
^^^^^^^^^^^^^^ types differ in mutability
|
note: expected signature `fn(&mut MyStruct)`
found signature `fn(&MyStruct)`
: change the self-receiver type to match the trait
|
fn drop<'a10>(mut self: &'a10 MyStruct) -> () {}
fn drop<'a10>(mut &mut self) -> () {}
|
more information about this error, try `rustc --explain E0053`.
r: could not compile `Foo` (lib) due to 1 previous error
"#]])
ect_test::expect![[r#"
es/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 mut MyStruct, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
es/formality-rust/src/prove/prove_normalize.rs:22:1: no applicable rules for prove_normalize { p: &!lt_0 MyStruct, assumptions: {}, env: Env { variables: [!lt_0], bias: Soundness, pending: [], allow_pending_outlives: false } }"#]]);
}
ust return unit, even when its body matches another return type.
#[test]
_non_unit_return() {
yTest::new(crates![crate Foo {
ct MyStruct {}
Drop for MyStruct {
fn drop<'a>(self: &'a mut MyStruct) -> u32 {
return 0_u32;
}
Source location: tests/drop.rs:228 (all coverage from this test)
fn drop<'a>(self: &'a mut MyStruct) -> u32 {
return 0_u32;
}
Source location: tests/drop.rs:250 (all coverage from this test)
Source location: tests/drop.rs:274 (all coverage from this test)
Source location: tests/drop.rs:313 (all coverage from this test)
Source location: tests/mir_typeck.rs:168 (all coverage from this test)
fn foo (b: bool) -> u32 {
if b {
return 1_u32;
} else {
return false;
}
}
Source location: tests/mir_typeck.rs:321 (all coverage from this test)
fn foo() -> () {
let s2: S2<S1>;
}
Source location: tests/mir_typeck.rs:392 (all coverage from this test)
fn bar(v1: ()) -> () {
let v0: () = foo(v1);
return v0;
}
Source location: tests/mir_typeck.rs:488 (all coverage from this test)
fn bar(v1: u32) -> u32 {
let v0: u32 = identity::<bool>(v1);
return v0;
}
Source location: tests/mir_typeck.rs:601 (all coverage from this test)
fn foo (v1: ()) -> u32 {
return v1;
}
Source location: tests/mir_typeck.rs:848 (all coverage from this test)
fn foo (v1: u32) -> u32 {
let v2: Dummy = Dummy { value: false };
return v1;
}
Source location: tests/mir_typeck.rs:1218 (all coverage from this test)
fn foo() -> () {
let x: i32 = 1_i32 + 2_u32;
}
Source location: tests/mir_typeck.rs:1270 (all coverage from this test)
fn foo() -> () {
let x: i32 = 10_i32 - 3_u32;
}
Source location: tests/mir_typeck.rs:1323 (all coverage from this test)
fn foo() -> () {
let x: i32 = 3_i32 * 4_u32;
}
Source location: tests/mir_typeck.rs:1394 (all coverage from this test)
fn main() -> () { require_marker::<S>; }
}])
tc_err(expect_test::expect![[r#"
error[E0277]: the trait bound `S: Marker` is not satisfied
--> lib.rs
|
13 | require_marker::<S>;
| ^ unsatisfied trait bound
|
help: the trait `Marker` is not implemented for `S`
--> lib.rs
|
3 | pub struct S {}
| ^^^^^^^^^^^^
help: this trait has no implementations, consider adding one
--> lib.rs
|
1 | pub trait Marker {}
| ^^^^^^^^^^^^^^^^
note: required by a bound in `require_marker`
--> lib.rs
|
5 | pub fn require_marker<T00>() -> ()
| -------------- required by a bound in this function
6 | where
7 | T00: Marker,
| ^^^^^^ required by this bound in `require_marker`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
ing the same function is still rejected. The where-clauses are now
ked both for the function name and by the call.
#[test]
generic_fn_call_with_unsatisfied_where_clause() {
alityTest::new(crates![crate test {
trait Marker {}
struct S {}
fn require_marker<T>() -> () where T: Marker { trusted }
fn main() -> () { require_marker::<S>(); }
}])
tc_err(expect_test::expect![[r#"
error[E0277]: the trait bound `S: Marker` is not satisfied
--> lib.rs
|
13 | require_marker::<S>();
| ^ unsatisfied trait bound
|
help: the trait `Marker` is not implemented for `S`
--> lib.rs
|
3 | pub struct S {}
| ^^^^^^^^^^^^
help: this trait has no implementations, consider adding one
--> lib.rs
|
1 | pub trait Marker {}
| ^^^^^^^^^^^^^^^^
note: required by a bound in `require_marker`
--> lib.rs
|
5 | pub fn require_marker<T00>() -> ()
| -------------- required by a bound in this function
6 | where
7 | T00: Marker,
| ^^^^^^ required by this bound in `require_marker`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
ng the function with a type that implements `Marker` is accepted.
#[test]
generic_fn_value_with_satisfied_where_clause() {
alityTest::new(crates![crate test {
trait Marker {}
impl Marker for u32 {}
fn require_marker<T>() -> () where T: Marker {}
fn main() -> () { require_marker::<u32>; }
}])
tc_ok()
);
}
#[test]
fn_value_with_forwarded_trait_bound() {
alityTest::new(crates![crate Foo {
trait Marker {}
impl Marker for u32 {}
fn require<T>() -> () where T: Marker {}
fn outer<T>() -> () where T: Marker { require::<T>; }
fn main() -> () { outer::<u32>(); }
}])
tc_ok()
);
}
#[test]
bare_fn_value_with_satisfied_where_clause() {
alityTest::new(crates![crate Foo {
trait Marker {}
impl Marker for u32 {}
fn require() -> () where u32: Marker {}
fn main() -> () { require; }
}])
tc_ok()
);
}
#[test]
fn_value_with_forwarded_lifetime_bound() {
alityTest::new(crates![crate Foo {
fn require<'a, 'b>() -> () where 'a: 'b {}
fn outer<'a, 'b>() -> () where 'a: 'b { require::<'a, 'b>; }
fn main() -> () { outer::<'static, 'static>(); }
}])
tc_ok()
);
}
#[test]
fn_value_with_unsatisfied_lifetime_bound() {
alityTest::new(crates![crate Foo {
fn require<'a, 'b>() -> () where 'a: 'b {}
fn outer<'a, 'b>() -> () { require::<'a, 'b>; }
fn main() -> () {}
}])
tc_err(expect_test::expect![[r#"
error: lifetime may not live long enough
--> lib.rs
|
7 | pub fn outer<'a00, 'a01>() -> () {
| ---- ---- lifetime `'a01` defined here
| |
| lifetime `'a00` defined here
8 | require::<'a00, 'a01>;
| ^^^^^^^^^^^^^^^^^^^^^ requires that `'a00` must outlive `'a01`
|
= help: consider adding the following bound: `'a00: 'a01`
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect!["crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_0, b: !lt_1, assumptions: {}, env: Env { variables: [!lt_0, !lt_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"]);
}
ound assignment of an integer of a different type should fail.
#[test]
compound_add_mismatched_int_types() {
alityTest::new(crates![crate Foo {
fn foo() -> () {
let x: u32 = 1_u32;
x += 2_u8;
}
Source location: tests/mir_typeck.rs:1438 (all coverage from this test)
fn main() -> () { require_marker::<S>(); }
}])
tc_err(expect_test::expect![[r#"
error[E0277]: the trait bound `S: Marker` is not satisfied
--> lib.rs
|
13 | require_marker::<S>();
| ^ unsatisfied trait bound
|
help: the trait `Marker` is not implemented for `S`
--> lib.rs
|
3 | pub struct S {}
| ^^^^^^^^^^^^
help: this trait has no implementations, consider adding one
--> lib.rs
|
1 | pub trait Marker {}
| ^^^^^^^^^^^^^^^^
note: required by a bound in `require_marker`
--> lib.rs
|
5 | pub fn require_marker<T00>() -> ()
| -------------- required by a bound in this function
6 | where
7 | T00: Marker,
| ^^^^^^ required by this bound in `require_marker`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `test` (lib) due to 1 previous error
)
(expect_test::expect![[r#"
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
ng the function with a type that implements `Marker` is accepted.
#[test]
generic_fn_value_with_satisfied_where_clause() {
alityTest::new(crates![crate test {
trait Marker {}
impl Marker for u32 {}
fn require_marker<T>() -> () where T: Marker {}
fn main() -> () { require_marker::<u32>; }
}])
tc_ok()
);
}
#[test]
fn_value_with_forwarded_trait_bound() {
alityTest::new(crates![crate Foo {
trait Marker {}
impl Marker for u32 {}
fn require<T>() -> () where T: Marker {}
fn outer<T>() -> () where T: Marker { require::<T>; }
fn main() -> () { outer::<u32>(); }
}])
tc_ok()
);
}
#[test]
bare_fn_value_with_satisfied_where_clause() {
alityTest::new(crates![crate Foo {
trait Marker {}
impl Marker for u32 {}
fn require() -> () where u32: Marker {}
fn main() -> () { require; }
}])
tc_ok()
);
}
#[test]
fn_value_with_forwarded_lifetime_bound() {
alityTest::new(crates![crate Foo {
fn require<'a, 'b>() -> () where 'a: 'b {}
fn outer<'a, 'b>() -> () where 'a: 'b { require::<'a, 'b>; }
fn main() -> () { outer::<'static, 'static>(); }
}])
tc_ok()
);
}
#[test]
fn_value_with_unsatisfied_lifetime_bound() {
alityTest::new(crates![crate Foo {
fn require<'a, 'b>() -> () where 'a: 'b {}
fn outer<'a, 'b>() -> () { require::<'a, 'b>; }
fn main() -> () {}
}])
tc_err(expect_test::expect![[r#"
error: lifetime may not live long enough
--> lib.rs
|
7 | pub fn outer<'a00, 'a01>() -> () {
| ---- ---- lifetime `'a01` defined here
| |
| lifetime `'a00` defined here
8 | require::<'a00, 'a01>;
| ^^^^^^^^^^^^^^^^^^^^^ requires that `'a00` must outlive `'a01`
|
= help: consider adding the following bound: `'a00: 'a01`
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect!["crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_0, b: !lt_1, assumptions: {}, env: Env { variables: [!lt_0, !lt_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"]);
}
ound assignment of an integer of a different type should fail.
#[test]
compound_add_mismatched_int_types() {
alityTest::new(crates![crate Foo {
fn foo() -> () {
let x: u32 = 1_u32;
x += 2_u8;
}
Source location: tests/mir_typeck.rs:1514 (all coverage from this test)
fn main() -> () {}
}])
tc_err(expect_test::expect![[r#"
error: lifetime may not live long enough
--> lib.rs
|
7 | pub fn outer<'a00, 'a01>() -> () {
| ---- ---- lifetime `'a01` defined here
| |
| lifetime `'a00` defined here
8 | require::<'a00, 'a01>;
| ^^^^^^^^^^^^^^^^^^^^^ requires that `'a00` must outlive `'a01`
|
= help: consider adding the following bound: `'a00: 'a01`
error: could not compile `Foo` (lib) due to 1 previous error
)
(expect_test::expect!["crates/formality-rust/src/prove/prove_outlives.rs:8:1: no applicable rules for prove_outlives { a: !lt_0, b: !lt_1, assumptions: {}, env: Env { variables: [!lt_0, !lt_1], bias: Soundness, pending: [], allow_pending_outlives: false } }"]);
}
ound assignment of an integer of a different type should fail.
#[test]
compound_add_mismatched_int_types() {
alityTest::new(crates![crate Foo {
fn foo() -> () {
let x: u32 = 1_u32;
x += 2_u8;
}
Source location: tests/mir_typeck.rs:1559 (all coverage from this test)
fn foo() -> () {
let x: u32 = 1_u32;
x += 2_u8;
}
Source location: tests/references.rs:13 (all coverage from this test)
Source location: tests/sized_trait.rs:27 (all coverage from this test)
#[test]
fn sized_bound_not_met_by_unimplemented_type() {
FormalityTest::new(crates![crate Foo {
struct S {}
trait Needs<T> where T: Sized {}
impl Needs<S> for u32 {}
}])
.rustc_ok()
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = &?lt_0 ?ty_1, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &?lt_0 ?ty_1, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = &?lt_0 mut ?ty_1, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &?lt_0 mut ?ty_1, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [?lt_0, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = (), via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: (), via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = bool, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: bool, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = i128, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i128, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = i16, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i16, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = i32, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i32, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = i64, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i64, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = i8, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i8, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = isize, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: isize, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = u128, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u128, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = u16, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u16, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = u32, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = u64, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u64, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = u8, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u8, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: S = usize, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: S, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: usize, via: Sized(S), assumptions: {Sized(S)}, env: Env { variables: [], 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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
Source location: tests/sized_trait.rs:187 (all coverage from this test)
#[test]
fn generic_parameter_requires_explicit_sized_bound() {
// Generated Rust still gives T an implicit Sized bound until #500 lands.
// Formality must already require an explicit bound on this impl.
FormalityTest::new(crates![crate Foo {
trait Needs<T> where T: Sized {}
impl<T> Needs<T> for u32 {}
}])
.rustc_ok()
.err(expect_test::expect![[r#"
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = &?lt_1 ?ty_2, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &?lt_1 ?ty_2, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = &?lt_1 mut ?ty_2, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: &?lt_1 mut ?ty_2, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0, ?lt_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_via.rs:9:1: no applicable rules for prove_via { goal: !ty_0 = (), via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: (), via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = bool, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: bool, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = i128, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i128, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = i16, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i16, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = i32, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i32, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = i64, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i64, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = i8, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: i8, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = isize, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: isize, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = u128, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u128, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = u16, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u16, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = u32, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u32, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = u64, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u64, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = u8, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: u8, via: Sized(!ty_0), assumptions: {Sized(!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: !ty_0 = usize, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: !ty_0, via: Sized(!ty_0), assumptions: {Sized(!ty_0)}, env: Env { variables: [!ty_0], bias: Soundness, pending: [], allow_pending_outlives: false } }
crates/formality-rust/src/prove/prove_normalize.rs:55:1: no applicable rules for prove_normalize_via { goal: usize, via: Sized(!ty_0), assumptions: {Sized(!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()`
the rule "trait implied bound" at (prove_predicate.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]]);
}
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()`"#]])
}