]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/impl-generic-mismatch.stderr
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / 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 `baz` has incompatible signature for trait
31   --> $DIR/impl-generic-mismatch.rs:26:33
32    |
33 LL |     fn baz<U: Debug, T: Debug>(&self, _: &U, _: &T);
34    |                      - declaration in trait here
35 ...
36 LL |     fn baz<T: Debug>(&self, _: &impl Debug, _: &T) { }
37    |                                 ^^^^^^^^^^ expected generic parameter, found `impl Trait`
38    |
39 help: try changing the `impl Trait` argument to a generic parameter
40    |
41 LL |     fn baz<U: Debug, T: Debug>(&self, _: &T, _: &T) { }
42    |           ~~~~~~~~~~~~~~~~~~~~            ~
43
44 error[E0643]: method `hash` has incompatible signature for trait
45   --> $DIR/impl-generic-mismatch.rs:37:33
46    |
47 LL |     fn hash(&self, hasher: &mut impl Hasher) {}
48    |                                 ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
49   --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
50    |
51    = note: declaration in trait here
52
53 error: aborting due to 4 previous errors
54
55 For more information about this error, try `rustc --explain E0643`.