Negative coverage: is_local_parameter / local rigid type / premise if decls.is_local_adt_id(a)
Premise at line 308. Observed failure causes: if_false.
local rigid type| Line | Coverage | Source |
|---|---|---|
| 308 | 3 | (if decls.is_local_adt_id(a)) |
| ──────── ("local rigid type") | ||
| 310 | 8 | (is_local_parameter(decls, env, _assumptions, RigidTy { name: RigidName::AdtId(a), parameters: _ }) => Constraints::none(env)) |
3 tests failed proving this premise:
Source location: tests/coherence_orphan.rs:12
#[test]
fn neg_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/prove/prove_normalize.rs:19: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"#]])
}
Failed proof tree
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:74check_coherence failedcoherence.rs:8rule "check_coherence"coherence.rs:23orphan_check_neg failedcoherence.rs:45rule "orphan_check_neg"coherence.rs:58prove failedfunction.rs:250rulefunction.rs:250prove_wc_list failedprove_wc_list.rs:11rule "some"prove_wc_list.rs:29prove_wc failedprove_wc.rs:23rule "trait ref is local"prove_wc.rs:148is_local_trait_ref failedis_local.rs:201rule "local parameter"is_local.rs:219is_local_parameter failedis_local.rs:279rule "local rigid type"is_local.rs:308 (failed: if_false)
Source location: tests/coherence_orphan.rs:47
#[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/prove/prove_normalize.rs:19: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"#]])
}
Failed proof tree
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:74check_coherence failedcoherence.rs:8rule "check_coherence"coherence.rs:21orphan_check failedcoherence.rs:31rule "orphan_check"coherence.rs:38prove failedfunction.rs:250rulefunction.rs:250prove_wc_list failedprove_wc_list.rs:11rule "some"prove_wc_list.rs:29prove_wc failedprove_wc.rs:23rule "trait ref is local"prove_wc.rs:148is_local_trait_ref failedis_local.rs:201rule "local parameter"is_local.rs:219is_local_parameter failedis_local.rs:279rule "local parameter"is_local.rs:293is_local_parameter failedis_local.rs:279rule "local rigid type"is_local.rs:308 (failed: if_false)
Source location: tests/coherence_orphan.rs:158
#[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/prove/prove_normalize.rs:19: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"#]])
}
Failed proof tree
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:74check_coherence failedcoherence.rs:8rule "check_coherence"coherence.rs:21orphan_check failedcoherence.rs:31rule "orphan_check"coherence.rs:38prove failedfunction.rs:250rulefunction.rs:250prove_wc_list failedprove_wc_list.rs:11rule "some"prove_wc_list.rs:29prove_wc failedprove_wc.rs:23rule "trait ref is local"prove_wc.rs:148is_local_trait_ref failedis_local.rs:201rule "local parameter"is_local.rs:219is_local_parameter failedis_local.rs:279rule "local rigid type"is_local.rs:308 (failed: if_false)