Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Negative coverage: is_local_trait_ref / local trait / premise if decls.is_local_trait_id(&goal.trait_id)

Premise at line 211. Observed failure causes: if_false.

local trait
LineCoverageSource
2116(if decls.is_local_trait_id(&goal.trait_id))
──────── ("local trait")
213109(is_local_trait_ref(decls, env, _assumptions, goal) => Constraints::none(env))

6 tests failed proving this premise:


Source location: crates/formality-rust/src/prove/prove/test/is_local.rs:11

#[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/prove/prove_normalize.rs:19: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

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

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

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

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

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