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: check_crate_item / trait impl / premise check_trait_impl(program, v, crate_id) => ()

Premise at line 178. Observed failure causes: failed_judgment.

trait impl
LineCoverageSource
1788(check_trait_impl(program, v, crate_id) => ())
1793(check_drop_impl_always_applicable(program, v) => ())
──────── ("trait impl")
181110(check_crate_item(program, CrateItem::TraitImpl(v), crate_id) => ())

8 tests failed proving this premise:


Source location: tests/basic_tests.rs:394

Failed proof tree

Source location: tests/basic_tests.rs:411

Failed proof tree

Source location: tests/coherence_overlap.rs:129

#[test]
fn u32_not_u32_impls() {
    FormalityTest::new(crates![crate core {
                trait Foo {}
                impl Foo for u32 {}
                impl !Foo for u32 {}
            }]).err(expect_test::expect![[r#"
            failed at (proven_set.rs) because
              found an unconditionally true solution Constraints { env: Env { variables: [], bias: Completeness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }"#]])
}
Failed proof tree

Source location: tests/coherence_overlap.rs:174

#[test]
fn T_where_Foo_not_u32_impls() {
    FormalityTest::new(crates![crate core {
                trait Foo {}
                impl<T> Foo for T where T: Foo {}
                impl !Foo for u32 {}
            }]).err(expect_test::expect![[r#"
            the rule "check_trait_impl" at (impls.rs) failed because
              failed to prove {! Foo(!ty_1)} given {Foo(!ty_1)}, got [Constraints { env: Env { variables: [!ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: false, substitution: {} }]"#]])
}
Failed proof tree

Source location: tests/consts.rs:32

#[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/prove/prove_normalize.rs:19: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/prove/prove_normalize.rs:19: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_wc.rs) failed because
                  expression evaluated to an empty collection: `decls.trait_invariants()`"#]])
}
Failed proof tree

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

Source location: tests/decl_safety.rs:63

#[test]
fn unsafe_trait_mismatch() {
    FormalityTest::new(crates![crate baguette {
        unsafe trait Foo {}
        impl Foo for u32 {}
    }])
    .err(expect_test::expect![[r#"
            the rule "safety matches" at (impls.rs) failed because
              condition evaluated to false: `trait_decl.safety == trait_impl.safety`"#]])
}
Failed proof tree

Source location: tests/decl_safety.rs:74

#[test]
fn safe_trait_mismatch() {
    FormalityTest::new(crates![crate baguette {
        trait Foo {}
        unsafe impl Foo for u32 {}
    }])
    .err(expect_test::expect![[r#"
            the rule "safety matches" at (impls.rs) failed because
              condition evaluated to false: `trait_decl.safety == trait_impl.safety`"#]])
}
Failed proof tree