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_safety_matches / safety matches / premise if trait_decl.safety == trait_impl.safety

Premise at line 78. Observed failure causes: if_false.

safety matches
LineCoverageSource
782(if trait_decl.safety == trait_impl.safety)
──────── ("safety matches")
80110(check_safety_matches(trait_decl, trait_impl) => ())

2 tests failed proving this premise:


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