]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/impl-generic-mismatch.stderr
New upstream version 1.44.1+dfsg1
[rustc.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:8: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 |
10 help: try removing the generic parameter and using `impl Trait` instead
11 |
12 LL | fn foo(&self, _: &impl Debug) { }
13 | -- ^^^^^^^^^^
14
15 error[E0643]: method `bar` has incompatible signature for trait
16 --> $DIR/impl-generic-mismatch.rs:17:23
17 |
18 LL | fn bar<U: Debug>(&self, _: &U);
19 | - declaration in trait here
20 ...
21 LL | fn bar(&self, _: &impl Debug) { }
22 | ^^^^^^^^^^ expected generic parameter, found `impl Trait`
23 |
24 help: try changing the `impl Trait` argument to a generic parameter
25 |
26 LL | fn bar<U: Debug>(&self, _: &U) { }
27 | ^^^^^^^^^^ ^
28
29 error[E0643]: method `hash` has incompatible signature for trait
30 --> $DIR/impl-generic-mismatch.rs:28:33
31 |
32 LL | fn hash(&self, hasher: &mut impl Hasher) {}
33 | ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
34 |
35 ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
36 |
37 LL | fn hash<H: Hasher>(&self, state: &mut H);
38 | - declaration in trait here
39
40 error: aborting due to 3 previous errors
41
42 For more information about this error, try `rustc --explain E0643`.