1- error[E0049 ]: method `foo` has 0 type parameters but its trait declaration has 1 type parameter
1+ error[E0053 ]: method `foo` has an incompatible generic parameter for trait
22 --> $DIR/mismatched_ty_const_in_trait_impl.rs:5:12
33 |
4- LL | fn foo<U>() {}
5- | - expected 1 type parameter
6- ...
74LL | fn foo<const M: u64>() {}
8- | ^^^^^^^^^^^^ found 0 type parameters
9-
10- error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
11- --> $DIR/mismatched_ty_const_in_trait_impl.rs:5 :12
5+ | ^^^^^^^^^^^^
6+ |
7+ note: the trait impl specifies `M` is a const parameter of type `u64`, but the declaration in trait `Trait::foo` requires it is a type parameter
8+ --> $DIR/mismatched_ty_const_in_trait_impl.rs:2 :12
129 |
1310LL | fn foo<U>() {}
14- | - expected 0 const parameters
15- ...
16- LL | fn foo<const M: u64>() {}
17- | ^^^^^^^^^^^^ found 1 const parameter
11+ | ^
1812
19- error[E0049 ]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
13+ error[E0053 ]: method `bar` has an incompatible generic parameter for trait
2014 --> $DIR/mismatched_ty_const_in_trait_impl.rs:13:12
2115 |
22- LL | fn bar<const M: u8>() {}
23- | ----------- expected 0 type parameters
24- ...
2516LL | fn bar<T>() {}
26- | ^ found 1 type parameter
27-
28- error[E0049]: method `bar` has 0 const parameters but its trait declaration has 1 const parameter
29- --> $DIR/mismatched_ty_const_in_trait_impl.rs:13 :12
17+ | ^
18+ |
19+ note: the trait impl specifies `T` is a type parameter, but the declaration in trait `Other::bar` requires it is a const parameter of type `u8`
20+ --> $DIR/mismatched_ty_const_in_trait_impl.rs:10 :12
3021 |
3122LL | fn bar<const M: u8>() {}
32- | ----------- expected 1 const parameter
33- ...
34- LL | fn bar<T>() {}
35- | ^ found 0 const parameters
23+ | ^^^^^^^^^^^
3624
3725error[E0053]: method `baz` has an incompatible const parameter type for trait
3826 --> $DIR/mismatched_ty_const_in_trait_impl.rs:21:12
@@ -46,7 +34,6 @@ note: the const parameter `N` has type `i32`, but the declaration in trait `Uwu:
4634LL | fn baz<const N: u32>() {}
4735 | ^^^^^^^^^^^^
4836
49- error: aborting due to 5 previous errors
37+ error: aborting due to 3 previous errors
5038
51- Some errors have detailed explanations: E0049, E0053.
52- For more information about an error, try `rustc --explain E0049`.
39+ For more information about this error, try `rustc --explain E0053`.
0 commit comments