Negative coverage: check_crate_item / neg trait impl / premise check_neg_trait_impl(program, i) => ()
Premise at line 214. Observed failure causes: failed_judgment.
neg trait impl| Line | Coverage | Source |
|---|---|---|
| 214 | 4 | (check_neg_trait_impl(program, i) => ()) |
| ──────── ("neg trait impl") | ||
| 216 | 3 | (check_crate_item(program, CrateItem::NegTraitImpl(i), crate_id) => ()) |
4 tests failed proving this premise:
Source location: tests/basic_tests.rs:466 (all coverage from this test)
#[test]
fn nonexistant_trait() {
FormalityTest::new(crates![crate core {
struct S {}
impl !Nonexistent for S {}
}])
.err(expect_test::expect![[r#"
the rule "check_neg_trait_impl" at (impls.rs) failed because
no trait named `Nonexistent`"#]]);
}
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180args
rule "neg trait impl"mod.rs:214check_neg_trait_impl failedimpls.rs:47args
rule "check_neg_trait_impl"impls.rs:67 (failed: inapplicable)
Source location: tests/decl_safety.rs:59 (all coverage from this test)
#[test]
fn unsafe_trait_negative_impl_mismatch() {
FormalityTest::new(crates![crate baguette {
#![feature(negative_impls)]
unsafe trait Foo {}
unsafe impl !Foo for u32 {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0198]: negative impls cannot be unsafe
--> lib.rs
|
5 | unsafe impl !Foo for u32 {}
| ------ -^^^
| | |
| | negative because of this
| unsafe because of this
For more information about this error, try `rustc --explain E0198`.
error: could not compile `baguette` (lib) due to 1 previous error
"#]])
.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:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180rule "neg trait impl"mod.rs:214check_neg_trait_impl failedimpls.rs:47rule "check_neg_trait_impl"impls.rs:55 (failed: explicit_failure)
Source location: tests/decl_safety.rs:84 (all coverage from this test)
#[test]
fn safe_trait_negative_impl_mismatch() {
FormalityTest::new(crates![crate baguette {
#![feature(negative_impls)]
trait Foo {}
unsafe impl !Foo for u32 {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0198]: negative impls cannot be unsafe
--> lib.rs
|
5 | unsafe impl !Foo for u32 {}
| ------ -^^^
| | |
| | negative because of this
| unsafe because of this
For more information about this error, try `rustc --explain E0198`.
error: could not compile `baguette` (lib) due to 1 previous error
"#]])
.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:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180rule "neg trait impl"mod.rs:214check_neg_trait_impl failedimpls.rs:47rule "check_neg_trait_impl"impls.rs:55 (failed: explicit_failure)
Source location: tests/sized_trait.rs:137 (all coverage from this test)
#[test]
fn user_defined_negative_sized_impl_is_rejected() {
FormalityTest::new(crates![crate Foo {
#![feature(negative_impls)]
struct S {}
impl !Sized for S {}
}])
.rustc_err(expect_test::expect![[r#"
error[E0322]: explicit impls for the `Sized` trait are not permitted
--> lib.rs
|
5 | impl !Sized for S {}
| ^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed
For more information about this error, try `rustc --explain E0322`.
error: could not compile `Foo` (lib) due to 1 previous error
"#]])
.err(expect_test::expect![[r#"
the rule "Sized" at (impls.rs) failed because
explicit impls for the `Sized` trait are not permitted"#]]);
}
Failed proof tree
check_all_crates failedmod.rs:42args
rule "check all prefixes"mod.rs:54check_crate failedmod.rs:61args
rule "check crate"mod.rs:75check_crate_item failedmod.rs:180rule "neg trait impl"mod.rs:214check_neg_trait_impl failedimpls.rs:47rule "check_neg_trait_impl"impls.rs:62check_trait_manually_implementable failedimpls.rs:76args
rule "Sized"impls.rs:85 (failed: explicit_failure)