summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/impl-generic-mismatch.stderr
blob: 489afd7615f5434c6319859d615e934671526e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
error[E0643]: method `foo` has incompatible signature for trait
  --> $DIR/impl-generic-mismatch.rs:8:12
   |
LL |     fn foo(&self, _: &impl Debug);
   |                       ---------- declaration in trait here
...
LL |     fn foo<U: Debug>(&self, _: &U) { }
   |            ^ expected `impl Trait`, found generic parameter
   |
help: try removing the generic parameter and using `impl Trait` instead
   |
LL -     fn foo<U: Debug>(&self, _: &U) { }
LL +     fn foo(&self, _: &impl Debug) { }
   |

error[E0643]: method `bar` has incompatible signature for trait
  --> $DIR/impl-generic-mismatch.rs:17:23
   |
LL |     fn bar<U: Debug>(&self, _: &U);
   |            - declaration in trait here
...
LL |     fn bar(&self, _: &impl Debug) { }
   |                       ^^^^^^^^^^ expected generic parameter, found `impl Trait`
   |
help: try changing the `impl Trait` argument to a generic parameter
   |
LL |     fn bar<U: Debug>(&self, _: &U) { }
   |           ++++++++++            ~

error[E0643]: method `hash` has incompatible signature for trait
  --> $DIR/impl-generic-mismatch.rs:28:33
   |
LL |     fn hash(&self, hasher: &mut impl Hasher) {}
   |                                 ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
   |
  ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
   |
LL |     fn hash<H: Hasher>(&self, state: &mut H);
   |             - declaration in trait here

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0643`.