]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/impl-generic-mismatch.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / impl-trait / impl-generic-mismatch.stderr
1 error[E0643]: method `foo` has incompatible signature for trait
2   --> $DIR/impl-generic-mismatch.rs:21:12
3    |
4 LL |     fn foo(&self, _: &impl Debug);
5    |                       ---------- declaration in trait here
6 ...
7 LL |     fn foo<U: Debug>(&self, _: &U) { }
8    |            ^ expected `impl Trait`, found generic parameter
9 help: try removing the generic parameter and using `impl Trait` instead
10    |
11 LL |     fn foo(&self, _: &impl Debug) { }
12    |          --           ^^^^^^^^^^
13
14 error[E0643]: method `bar` has incompatible signature for trait
15   --> $DIR/impl-generic-mismatch.rs:30:23
16    |
17 LL |     fn bar<U: Debug>(&self, _: &U);
18    |            - declaration in trait here
19 ...
20 LL |     fn bar(&self, _: &impl Debug) { }
21    |                       ^^^^^^^^^^ expected generic parameter, found `impl Trait`
22 help: try changing the `impl Trait` argument to a generic parameter
23    |
24 LL |     fn bar<U: Debug>(&self, _: &U) { }
25    |           ^^^^^^^^^^            ^
26
27 error[E0643]: method `hash` has incompatible signature for trait
28   --> $DIR/impl-generic-mismatch.rs:41:33
29    |
30 LL |     fn hash(&self, hasher: &mut impl Hasher) {}
31    |                                 ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
32    | 
33   ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
34    |
35 LL |     fn hash<H: Hasher>(&self, state: &mut H);
36    |             - declaration in trait here
37
38 error: aborting due to 3 previous errors
39
40 For more information about this error, try `rustc --explain E0643`.