Negative coverage: check_trait_manually_implementable / Sized / premise fail "explicit impls for the Sized trait are not permitted"
Premise at line 85. Observed failure causes: explicit_failure.
Sized| Line | Coverage | Source |
|---|---|---|
| 84 | ✗ | (if trait_id.is_sized()) |
| 85 | 2 | (fail "explicit impls for the `Sized` trait are not permitted") |
| ──────── ("Sized") | ||
| 87 | ✗ | (check_trait_manually_implementable(trait_id) => ()) |
2 tests failed proving this premise:
Source location: tests/sized_trait.rs:115 (all coverage from this test)
#[test]
fn user_defined_sized_impl_is_rejected() {
FormalityTest::new(crates![crate Foo {
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
|
3 | 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 "trait impl"mod.rs:195check_trait_impl failedimpls.rs:14rule "check_trait_impl"impls.rs:24check_trait_manually_implementable failedimpls.rs:76args
rule "Sized"impls.rs:85 (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)