@@ -27,8 +27,22 @@ help: try changing the `impl Trait` argument to a generic parameter
2727LL | fn bar<U: Debug>(&self, _: &U) { }
2828 | ++++++++++ ~
2929
30+ error[E0643]: method `baz` has incompatible signature for trait
31+ --> $DIR/impl-generic-mismatch.rs:26:33
32+ |
33+ LL | fn baz<U: Debug, T: Debug>(&self, _: &U, _: &T);
34+ | - declaration in trait here
35+ ...
36+ LL | fn baz<T: Debug>(&self, _: &impl Debug, _: &T) { }
37+ | ^^^^^^^^^^ expected generic parameter, found `impl Trait`
38+ |
39+ help: try changing the `impl Trait` argument to a generic parameter
40+ |
41+ LL | fn baz<U: Debug, T: Debug>(&self, _: &T, _: &T) { }
42+ | ~~~~~~~~~~~~~~~~~~~~ ~
43+
3044error[E0643]: method `hash` has incompatible signature for trait
31- --> $DIR/impl-generic-mismatch.rs:28 :33
45+ --> $DIR/impl-generic-mismatch.rs:37 :33
3246 |
3347LL | fn hash(&self, hasher: &mut impl Hasher) {}
3448 | ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
@@ -38,6 +52,6 @@ LL | fn hash(&self, hasher: &mut impl Hasher) {}
3852LL | fn hash<H: Hasher>(&self, state: &mut H);
3953 | - declaration in trait here
4054
41- error: aborting due to 3 previous errors
55+ error: aborting due to 4 previous errors
4256
4357For more information about this error, try `rustc --explain E0643`.
0 commit comments