Negative coverage: check_crate / check crate / premise check_coherence(program, c) => ()
Premise at line 74. Observed failure causes: failed_judgment.
check crate| Line | Coverage | Source |
|---|---|---|
| 70 | 6 | (check_for_duplicate_items(program) => ()) |
| 71 | 6 | (check_for_non_lifetime_binders(c) => ()) |
| 72 | ✗ | (for_all(item in &c.items) (check_crate_item(program, item, &c.id) => ())) |
| 74 | 11 | (check_coherence(program, c) => ()) |
| ──────── ("check crate") | ||
| 76 | 114 | (check_crate(program, Crate { id: _id, items: _items }) => ()) |
11 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 "fundamental rigid type"is_local.rs:300 (failed: if_false)rule "local parameter"is_local.rs:291prove_normalize failedprove_normalize.rs:19
rule "local rigid type"is_local.rs:308 (failed: if_false)
rule "local trait"is_local.rs:211 (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 "fundamental rigid type"is_local.rs:300 (failed: if_false)rule "local parameter"is_local.rs:291prove_normalize failedprove_normalize.rs:19
rule "local rigid type"is_local.rs:308 (failed: if_false)
rule "local trait"is_local.rs:211 (failed: if_false)
Source location: tests/coherence_orphan.rs:109
#[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/prove/prove_normalize.rs:19: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/prove/prove_normalize.rs:19: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"#]])
}
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:291prove_normalize failedprove_normalize.rs:19
rule "local parameter"is_local.rs:224is_not_downstream failedis_local.rs:231rule "via normalize"is_local.rs:262prove_normalize failedprove_normalize.rs:19
rule "local trait"is_local.rs:211 (failed: if_false)
Source location: tests/coherence_orphan.rs:136
#[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/prove/prove_normalize.rs:19: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"#]])
}
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 "fundamental rigid type"is_local.rs:300 (failed: if_false)rule "local parameter"is_local.rs:291prove_normalize failedprove_normalize.rs:19
rule "local trait"is_local.rs:211 (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 "fundamental rigid type"is_local.rs:300 (failed: if_false)rule "local parameter"is_local.rs:291prove_normalize failedprove_normalize.rs:19
rule "local rigid type"is_local.rs:308 (failed: if_false)
rule "local trait"is_local.rs:211 (failed: if_false)
Source location: tests/coherence_overlap.rs:161
#[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 "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl <ty> FooTrait for ^ty0_0 where ^ty0_0 : CoreTrait { }
impl FooTrait for CoreStruct { }"#]])
}
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:19 (failed: inapplicable)
Source location: tests/coherence_overlap.rs:189
#[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 "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl Foo for u32 { }
impl <ty> Foo for ^ty0_0 where ^ty0_0 : Is { }"#]])
}
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:19 (failed: inapplicable)
Source location: tests/coherence_overlap.rs:239
#[test]
fn u32_T_impls() {
FormalityTest::new(crates![crate core {
trait Foo {}
impl Foo for u32 {}
impl<T> Foo for T {}
}])
.err(expect_test::expect![[r#"
the rule "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl Foo for u32 { }
impl <ty> Foo for ^ty0_0 { }"#]])
}
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:19 (failed: inapplicable)
Source location: tests/coherence_overlap.rs:257
#[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 "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl <ty> Foo for ^ty0_0 { }
impl <ty> Foo for ^ty0_0 where ^ty0_0 : Bar { }"#]])
}
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:19 (failed: inapplicable)
Source location: tests/coherence_overlap.rs:277
#[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 "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl <ty> Foo for ^ty0_0 { }
impl <ty> Foo for ^ty0_0 where LocalType : Bar <^ty0_0> { }"#]])
}
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:19 (failed: inapplicable)
Source location: tests/coherence_overlap.rs:333
#[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 "check_coherence" at (coherence.rs) failed because
impls may overlap:
impl <ty, ty> Overlap <^ty0_1> for ^ty0_0 where <^ty0_0 as Project>::Assoc : Foo <^ty0_1> { }
impl <ty> Overlap <LocalType> for ^ty0_0 { }"#]])
}
Proof trees omitted for the remaining 1 tests.