]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/impl-generic-mismatch.stderr
Rollup merge of #95504 - jyn514:library-alias, r=Mark-Simulacrum
[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: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<U: Debug>(&self, _: &U) { }
13 LL +     fn foo(&self, _: &impl Debug) { }
14    | 
15
16 error[E0643]: method `bar` has incompatible signature for trait
17   --> $DIR/impl-generic-mismatch.rs:17:23
18    |
19 LL |     fn bar<U: Debug>(&self, _: &U);
20    |            - declaration in trait here
21 ...
22 LL |     fn bar(&self, _: &impl Debug) { }
23    |                       ^^^^^^^^^^ expected generic parameter, found `impl Trait`
24    |
25 help: try changing the `impl Trait` argument to a generic parameter
26    |
27 LL |     fn bar<U: Debug>(&self, _: &U) { }
28    |           ++++++++++            ~
29
30 error[E0643]: method `hash` has incompatible signature for trait
31   --> $DIR/impl-generic-mismatch.rs:28:33
32    |
33 LL |     fn hash(&self, hasher: &mut impl Hasher) {}
34    |                                 ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
35    |
36   ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
37    |
38 LL |     fn hash<H: Hasher>(&self, state: &mut H);
39    |             - declaration in trait here
40
41 error: aborting due to 3 previous errors
42
43 For more information about this error, try `rustc --explain E0643`.