diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs index 590131e4f6ae..3e15079552ce 100644 --- a/compiler/rustc_typeck/src/check/compare_method.rs +++ b/compiler/rustc_typeck/src/check/compare_method.rs @@ -1003,7 +1003,7 @@ fn compare_generic_param_kinds<'tcx>( } { let make_param_message = |prefix: &str, param: &ty::GenericParamDef| match param.kind { Const { .. } => { - format!("{} const parameter with type `{}`", prefix, tcx.type_of(param.def_id)) + format!("{} const parameter of type `{}`", prefix, tcx.type_of(param.def_id)) } Type { .. } => format!("{} type parameter", prefix), Lifetime { .. } => unreachable!(), @@ -1016,7 +1016,7 @@ fn compare_generic_param_kinds<'tcx>( tcx.sess, param_impl_span, E0053, - "{} `{}` has an incompatible generic parameter for trait: `{}`", + "{} `{}` has an incompatible generic parameter for trait `{}`", assoc_item_kind_str(&impl_item), trait_item.name, &tcx.def_path_str(tcx.parent(trait_item.def_id)) diff --git a/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr b/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr index a1ec8adec76a..3455f2c8ea97 100644 --- a/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr +++ b/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr @@ -1,4 +1,4 @@ -error[E0053]: method `foo` has an incompatible generic parameter for trait: `Trait` +error[E0053]: method `foo` has an incompatible generic parameter for trait `Trait` --> $DIR/mismatched_ty_const_in_trait_impl.rs:5:12 | LL | trait Trait { @@ -9,48 +9,48 @@ LL | } LL | impl Trait for () { | ----------------- LL | fn foo() {} - | ^^^^^^^^^^^^ found const parameter with type `u64` + | ^^^^^^^^^^^^ found const parameter of type `u64` -error[E0053]: method `bar` has an incompatible generic parameter for trait: `Other` +error[E0053]: method `bar` has an incompatible generic parameter for trait `Other` --> $DIR/mismatched_ty_const_in_trait_impl.rs:13:12 | LL | trait Other { | ----- LL | fn bar() {} - | ----------- expected const parameter with type `u8` + | ----------- expected const parameter of type `u8` LL | } LL | impl Other for () { | ----------------- LL | fn bar() {} | ^ found type parameter -error[E0053]: method `baz` has an incompatible generic parameter for trait: `Uwu` +error[E0053]: method `baz` has an incompatible generic parameter for trait `Uwu` --> $DIR/mismatched_ty_const_in_trait_impl.rs:21:12 | LL | trait Uwu { | --- LL | fn baz() {} - | ------------ expected const parameter with type `u32` + | ------------ expected const parameter of type `u32` LL | } LL | impl Uwu for () { | --------------- LL | fn baz() {} - | ^^^^^^^^^^^^ found const parameter with type `i32` + | ^^^^^^^^^^^^ found const parameter of type `i32` -error[E0053]: method `bbbb` has an incompatible generic parameter for trait: `Aaaaaa` +error[E0053]: method `bbbb` has an incompatible generic parameter for trait `Aaaaaa` --> $DIR/mismatched_ty_const_in_trait_impl.rs:29:13 | LL | trait Aaaaaa { | ------ LL | fn bbbb() {} - | ------------ expected const parameter with type `u32` + | ------------ expected const parameter of type `u32` LL | } LL | impl Aaaaaa for () { | ------------------ LL | fn bbbb() {} | ^ found type parameter -error[E0053]: method `abcd` has an incompatible generic parameter for trait: `Names` +error[E0053]: method `abcd` has an incompatible generic parameter for trait `Names` --> $DIR/mismatched_ty_const_in_trait_impl.rs:37:13 | LL | trait Names { @@ -61,7 +61,7 @@ LL | } LL | impl Names for () { | ----------------- LL | fn abcd() {} - | ^^^^^^^^^^^^ found const parameter with type `u32` + | ^^^^^^^^^^^^ found const parameter of type `u32` error: aborting due to 5 previous errors diff --git a/src/test/ui/const-generics/issues/issue-86820.rs b/src/test/ui/const-generics/issues/issue-86820.rs index 9bcb8e1aeed3..ae4bd943fd41 100644 --- a/src/test/ui/const-generics/issues/issue-86820.rs +++ b/src/test/ui/const-generics/issues/issue-86820.rs @@ -14,7 +14,7 @@ trait Bits { impl Bits for u8 { fn bit(self) -> bool { - //~^ ERROR: method `bit` has an incompatible generic parameter for trait: `Bits` [E0053] + //~^ ERROR: method `bit` has an incompatible generic parameter for trait `Bits` [E0053] let i = 1 << I; let mask = u8::from(i); mask & self == mask diff --git a/src/test/ui/const-generics/issues/issue-86820.stderr b/src/test/ui/const-generics/issues/issue-86820.stderr index 4d54d654c12d..3a9cd957f35e 100644 --- a/src/test/ui/const-generics/issues/issue-86820.stderr +++ b/src/test/ui/const-generics/issues/issue-86820.stderr @@ -1,15 +1,15 @@ -error[E0053]: method `bit` has an incompatible generic parameter for trait: `Bits` +error[E0053]: method `bit` has an incompatible generic parameter for trait `Bits` --> $DIR/issue-86820.rs:16:12 | LL | trait Bits { | ---- LL | fn bit(self) -> bool; - | ----------- expected const parameter with type `u8` + | ----------- expected const parameter of type `u8` ... LL | impl Bits for u8 { | ---------------- LL | fn bit(self) -> bool { - | ^^^^^^^^^^^^^^ found const parameter with type `usize` + | ^^^^^^^^^^^^^^ found const parameter of type `usize` error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr index 9b8eddaff41b..89c993dee5e6 100644 --- a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr +++ b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr @@ -1,15 +1,15 @@ -error[E0053]: type `Foo` has an incompatible generic parameter for trait: `Trait` +error[E0053]: type `Foo` has an incompatible generic parameter for trait `Trait` --> $DIR/const_params_have_right_type.rs:8:14 | LL | trait Trait { | ----- LL | type Foo; - | ----------- expected const parameter with type `u8` + | ----------- expected const parameter of type `u8` ... LL | impl Trait for () { | ----------------- LL | type Foo = u32; - | ^^^^^^^^^^^^ found const parameter with type `u64` + | ^^^^^^^^^^^^ found const parameter of type `u64` error: aborting due to previous error