fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB42 linesraw
1error[E0643]: method `foo` has incompatible signature for trait
2  --> $DIR/impl-generic-mismatch.rs:8:12
3   |
4LL |     fn foo(&self, _: &impl Debug);
5   |                       ---------- declaration in trait here
6...
7LL |     fn foo<U: Debug>(&self, _: &U) { }
8   |            ^ expected `impl Trait`, found generic parameter
9   |
10help: try removing the generic parameter and using `impl Trait` instead
11   |
12LL |     fn foo(&self, _: &impl Debug) { }
13   |          --           ^^^^^^^^^^
14
15error[E0643]: method `bar` has incompatible signature for trait
16  --> $DIR/impl-generic-mismatch.rs:17:23
17   |
18LL |     fn bar<U: Debug>(&self, _: &U);
19   |            - declaration in trait here
20...
21LL |     fn bar(&self, _: &impl Debug) { }
22   |                       ^^^^^^^^^^ expected generic parameter, found `impl Trait`
23   |
24help: try changing the `impl Trait` argument to a generic parameter
25   |
26LL |     fn bar<U: Debug>(&self, _: &U) { }
27   |           ^^^^^^^^^^            ^
28
29error[E0643]: method `hash` has incompatible signature for trait
30  --> $DIR/impl-generic-mismatch.rs:28:33
31   |
32LL |     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   |
37LL |     fn hash<H: Hasher>(&self, state: &mut H);
38   |             - declaration in trait here
39
40error: aborting due to 3 previous errors
41
42For more information about this error, try `rustc --explain E0643`.