Skip to content

Commit 2819b2d

Browse files
committed
wording tweaks
1 parent fea1d76 commit 2819b2d

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

compiler/rustc_typeck/src/check/compare_method.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ fn compare_generic_param_kinds<'tcx>(
10031003
} {
10041004
let make_param_message = |prefix: &str, param: &ty::GenericParamDef| match param.kind {
10051005
Const { .. } => {
1006-
format!("{} const parameter with type `{}`", prefix, tcx.type_of(param.def_id))
1006+
format!("{} const parameter of type `{}`", prefix, tcx.type_of(param.def_id))
10071007
}
10081008
Type { .. } => format!("{} type parameter", prefix),
10091009
Lifetime { .. } => unreachable!(),
@@ -1016,7 +1016,7 @@ fn compare_generic_param_kinds<'tcx>(
10161016
tcx.sess,
10171017
param_impl_span,
10181018
E0053,
1019-
"{} `{}` has an incompatible generic parameter for trait: `{}`",
1019+
"{} `{}` has an incompatible generic parameter for trait `{}`",
10201020
assoc_item_kind_str(&impl_item),
10211021
trait_item.name,
10221022
&tcx.def_path_str(tcx.parent(trait_item.def_id))

src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0053]: method `foo` has an incompatible generic parameter for trait: `Trait`
1+
error[E0053]: method `foo` has an incompatible generic parameter for trait `Trait`
22
--> $DIR/mismatched_ty_const_in_trait_impl.rs:5:12
33
|
44
LL | trait Trait {
@@ -9,48 +9,48 @@ LL | }
99
LL | impl Trait for () {
1010
| -----------------
1111
LL | fn foo<const M: u64>() {}
12-
| ^^^^^^^^^^^^ found const parameter with type `u64`
12+
| ^^^^^^^^^^^^ found const parameter of type `u64`
1313

14-
error[E0053]: method `bar` has an incompatible generic parameter for trait: `Other`
14+
error[E0053]: method `bar` has an incompatible generic parameter for trait `Other`
1515
--> $DIR/mismatched_ty_const_in_trait_impl.rs:13:12
1616
|
1717
LL | trait Other {
1818
| -----
1919
LL | fn bar<const M: u8>() {}
20-
| ----------- expected const parameter with type `u8`
20+
| ----------- expected const parameter of type `u8`
2121
LL | }
2222
LL | impl Other for () {
2323
| -----------------
2424
LL | fn bar<T>() {}
2525
| ^ found type parameter
2626

27-
error[E0053]: method `baz` has an incompatible generic parameter for trait: `Uwu`
27+
error[E0053]: method `baz` has an incompatible generic parameter for trait `Uwu`
2828
--> $DIR/mismatched_ty_const_in_trait_impl.rs:21:12
2929
|
3030
LL | trait Uwu {
3131
| ---
3232
LL | fn baz<const N: u32>() {}
33-
| ------------ expected const parameter with type `u32`
33+
| ------------ expected const parameter of type `u32`
3434
LL | }
3535
LL | impl Uwu for () {
3636
| ---------------
3737
LL | fn baz<const N: i32>() {}
38-
| ^^^^^^^^^^^^ found const parameter with type `i32`
38+
| ^^^^^^^^^^^^ found const parameter of type `i32`
3939

40-
error[E0053]: method `bbbb` has an incompatible generic parameter for trait: `Aaaaaa`
40+
error[E0053]: method `bbbb` has an incompatible generic parameter for trait `Aaaaaa`
4141
--> $DIR/mismatched_ty_const_in_trait_impl.rs:29:13
4242
|
4343
LL | trait Aaaaaa {
4444
| ------
4545
LL | fn bbbb<const N: u32, T>() {}
46-
| ------------ expected const parameter with type `u32`
46+
| ------------ expected const parameter of type `u32`
4747
LL | }
4848
LL | impl Aaaaaa for () {
4949
| ------------------
5050
LL | fn bbbb<T, const N: u32>() {}
5151
| ^ found type parameter
5252

53-
error[E0053]: method `abcd` has an incompatible generic parameter for trait: `Names`
53+
error[E0053]: method `abcd` has an incompatible generic parameter for trait `Names`
5454
--> $DIR/mismatched_ty_const_in_trait_impl.rs:37:13
5555
|
5656
LL | trait Names {
@@ -61,7 +61,7 @@ LL | }
6161
LL | impl Names for () {
6262
| -----------------
6363
LL | fn abcd<const N: u32, T>() {}
64-
| ^^^^^^^^^^^^ found const parameter with type `u32`
64+
| ^^^^^^^^^^^^ found const parameter of type `u32`
6565

6666
error: aborting due to 5 previous errors
6767

src/test/ui/const-generics/issues/issue-86820.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait Bits {
1414

1515
impl Bits for u8 {
1616
fn bit<const I: usize>(self) -> bool {
17-
//~^ ERROR: method `bit` has an incompatible generic parameter for trait: `Bits` [E0053]
17+
//~^ ERROR: method `bit` has an incompatible generic parameter for trait `Bits` [E0053]
1818
let i = 1 << I;
1919
let mask = u8::from(i);
2020
mask & self == mask

src/test/ui/const-generics/issues/issue-86820.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
error[E0053]: method `bit` has an incompatible generic parameter for trait: `Bits`
1+
error[E0053]: method `bit` has an incompatible generic parameter for trait `Bits`
22
--> $DIR/issue-86820.rs:16:12
33
|
44
LL | trait Bits {
55
| ----
66
LL | fn bit<const I: u8>(self) -> bool;
7-
| ----------- expected const parameter with type `u8`
7+
| ----------- expected const parameter of type `u8`
88
...
99
LL | impl Bits for u8 {
1010
| ----------------
1111
LL | fn bit<const I: usize>(self) -> bool {
12-
| ^^^^^^^^^^^^^^ found const parameter with type `usize`
12+
| ^^^^^^^^^^^^^^ found const parameter of type `usize`
1313

1414
error: aborting due to previous error
1515

src/test/ui/generic-associated-types/const_params_have_right_type.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
error[E0053]: type `Foo` has an incompatible generic parameter for trait: `Trait`
1+
error[E0053]: type `Foo` has an incompatible generic parameter for trait `Trait`
22
--> $DIR/const_params_have_right_type.rs:8:14
33
|
44
LL | trait Trait {
55
| -----
66
LL | type Foo<const N: u8>;
7-
| ----------- expected const parameter with type `u8`
7+
| ----------- expected const parameter of type `u8`
88
...
99
LL | impl Trait for () {
1010
| -----------------
1111
LL | type Foo<const N: u64> = u32;
12-
| ^^^^^^^^^^^^ found const parameter with type `u64`
12+
| ^^^^^^^^^^^^ found const parameter of type `u64`
1313

1414
error: aborting due to previous error
1515

0 commit comments

Comments
 (0)