fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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