Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update explicit impls error msg #97627

Merged
merged 1 commit into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/coherence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn enforce_trait_manually_implementable(
E0322,
"explicit impls for the `Pointee` trait are not permitted"
)
.span_label(span, "impl of 'Pointee' not allowed")
.span_label(span, "impl of `Pointee` not allowed")
.emit();
return;
}
Expand All @@ -70,7 +70,7 @@ fn enforce_trait_manually_implementable(
E0322,
"explicit impls for the `DiscriminantKind` trait are not permitted"
)
.span_label(span, "impl of 'DiscriminantKind' not allowed")
.span_label(span, "impl of `DiscriminantKind` not allowed")
.emit();
return;
}
Expand All @@ -83,7 +83,7 @@ fn enforce_trait_manually_implementable(
E0322,
"explicit impls for the `Sized` trait are not permitted"
)
.span_label(span, "impl of 'Sized' not allowed")
.span_label(span, "impl of `Sized` not allowed")
.emit();
return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/coherence/coherence-impls-sized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,37 @@ error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:14:1
|
LL | impl Sized for TestE {}
| ^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:17:1
|
LL | impl Sized for MyType {}
| ^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:20:1
|
LL | impl Sized for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:24:1
|
LL | impl Sized for &'static NotSync {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:27:1
|
LL | impl Sized for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error[E0322]: explicit impls for the `Sized` trait are not permitted
--> $DIR/coherence-impls-sized.rs:31:1
|
LL | impl Sized for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed

error: aborting due to 9 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0322]: explicit impls for the `DiscriminantKind` trait are not permitted
--> $DIR/forbidden-discriminant-kind-impl.rs:9:1
|
LL | impl DiscriminantKind for NewType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'DiscriminantKind' not allowed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `DiscriminantKind` not allowed

error: aborting due to previous error

Expand Down