Negative coverage: prove_wc / const has ty / premise prove_const_has_type(decls, env, assumptions, constant) => (ty_constant, c)
Premise at line 167. Observed failure causes: failed_judgment.
const has ty| Line | Coverage | Source |
|---|---|---|
| 167 | 1 | (prove_const_has_type(decls, env, assumptions, constant) => (ty_constant, c)) |
| 168 | 1 | (prove_after(decls, c, assumptions, Relation::equals(ty_constant, ty)) => c) |
| ──────── ("const has ty") | ||
| 170 | 3 | (prove_wc(decls, env, assumptions, Predicate::ConstHasType(constant, ty)) => c) |
1 test failed proving this premise:
Source location: tests/consts.rs:68
#[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/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/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/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/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/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 i8 { } impl Copy for i16 { } impl Copy for i32 { } impl Copy for i64 { } impl Copy for bool { } impl Copy for usize { } impl Copy for isize { } impl <lt, ty> Copy for &^lt0_0 ^ty0_1 { } trait Drop <ty> { } 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 &mut ^lt0_0 ^ty0_1 where ^ty0_1 : ^lt0_0 { type Target = ^ty1_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_wc.rs) failed because
expression evaluated to an empty collection: `decls.trait_invariants()`"#]])
}
Failed proof tree
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:73check_crate_item failedmod.rs:163rule "trait impl"mod.rs:178check_trait_impl failedimpls.rs:13rule "check_trait_impl"impls.rs:27prove failedfunction.rs:250rulefunction.rs:250prove_wc_list failedprove_wc_list.rs:11rule "some"prove_wc_list.rs:29prove_wc failedprove_wc.rs:23rule "positive impl"prove_wc.rs:88prove_after failedprove_after.rs:8rule "prove_after"prove_after.rs:19prove failedprove_after.rs:19ruleprove_after.rs:19prove_wc_list failedprove_wc_list.rs:11rule "some"prove_wc_list.rs:29prove_wc failedprove_wc.rs:23rule "const has ty"prove_wc.rs:167prove_const_has_type failedprove_const_has_type.rs:11