-
Notifications
You must be signed in to change notification settings - Fork 13.2k
/
Copy pathimpl-generic-mismatch.stderr
40 lines (36 loc) · 1.46 KB
/
impl-generic-mismatch.stderr
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
error[E0643]: method `foo` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:18: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(&self, _: &impl Debug) { }
| -- ^^^^^^^^^^
error[E0643]: method `bar` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:27: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:38:33
|
LL | fn hash(&self, hasher: &mut impl Hasher) {}
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
::: $SRC_DIR/libcore/hash/mod.rs:185:13
|
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`.