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| Line | Coverage | Source |
|---|---|---|
| 197 | 2 | (check_neg_trait_impl(program, i) => ()) |
| ──────── ("neg trait impl") | ||
| 199 | 3 | (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
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:73check_crate_item failedmod.rs:163rule "neg trait impl"mod.rs:197check_neg_trait_impl failedimpls.rs:45rule "check_neg_trait_impl"impls.rs:53 (failed: explicit_failure)
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
check_all_crates failedmod.rs:41rule "check all prefixes"mod.rs:53check_crate failedmod.rs:60rule "check crate"mod.rs:73check_crate_item failedmod.rs:163rule "neg trait impl"mod.rs:197check_neg_trait_impl failedimpls.rs:45rule "check_neg_trait_impl"impls.rs:53 (failed: explicit_failure)