Skip to content

Commit 992ca9b

Browse files
authored
Rollup merge of #97627 - lcnr:comment-tick, r=Dylan-DPC
update explicit impls error msg
2 parents ba54e75 + 79c3011 commit 992ca9b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

compiler/rustc_typeck/src/coherence/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn enforce_trait_manually_implementable(
5757
E0322,
5858
"explicit impls for the `Pointee` trait are not permitted"
5959
)
60-
.span_label(span, "impl of 'Pointee' not allowed")
60+
.span_label(span, "impl of `Pointee` not allowed")
6161
.emit();
6262
return;
6363
}
@@ -70,7 +70,7 @@ fn enforce_trait_manually_implementable(
7070
E0322,
7171
"explicit impls for the `DiscriminantKind` trait are not permitted"
7272
)
73-
.span_label(span, "impl of 'DiscriminantKind' not allowed")
73+
.span_label(span, "impl of `DiscriminantKind` not allowed")
7474
.emit();
7575
return;
7676
}
@@ -83,7 +83,7 @@ fn enforce_trait_manually_implementable(
8383
E0322,
8484
"explicit impls for the `Sized` trait are not permitted"
8585
)
86-
.span_label(span, "impl of 'Sized' not allowed")
86+
.span_label(span, "impl of `Sized` not allowed")
8787
.emit();
8888
return;
8989
}

src/test/ui/coherence/coherence-impls-sized.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,37 @@ error[E0322]: explicit impls for the `Sized` trait are not permitted
3535
--> $DIR/coherence-impls-sized.rs:14:1
3636
|
3737
LL | impl Sized for TestE {}
38-
| ^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
38+
| ^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed
3939

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

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

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

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

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

7070
error: aborting due to 9 previous errors
7171

src/test/ui/enum-discriminant/forbidden-discriminant-kind-impl.stderr

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

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)