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 / neg trait impl / premise check_neg_trait_impl(program, i) => ()

Premise at line 197. Observed failure causes: failed_judgment.

neg trait impl
LineCoverageSource
1972(check_neg_trait_impl(program, i) => ())
──────── ("neg trait impl")
1993(check_crate_item(program, CrateItem::NegTraitImpl(i), crate_id) => ())

2 tests failed proving this premise:


Source location: tests/decl_safety.rs:41

#[test]
fn unsafe_trait_negative_impl_mismatch() {
    FormalityTest::new(crates![crate baguette {
        unsafe trait Foo {}
        unsafe impl !Foo for u32 {}
    }])
    .err(expect_test::expect![[r#"
        the rule "check_neg_trait_impl" at (impls.rs) failed because
          negative impls cannot be unsafe"#]])
}
Failed proof tree

Source location: tests/decl_safety.rs:52

#[test]
fn safe_trait_negative_impl_mismatch() {
    FormalityTest::new(crates![crate baguette {
        trait Foo {}
        unsafe impl !Foo for u32 {}
    }])
    .err(expect_test::expect![[r#"
        the rule "check_neg_trait_impl" at (impls.rs) failed because
          negative impls cannot be unsafe"#]])
}
Failed proof tree