fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.0 KiB81 linesraw
1error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(u32)`
2  --> $DIR/mismatch-fn-trait.rs:4:10
3   |
4LL |     take(f)
5   |     ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(u32)`
6   |     |
7   |     required by a bound introduced by this call
8   |
9   = note: expected a closure with arguments `(u32,)`
10              found a closure with arguments `(i32,)`
11note: required by a bound in `take`
12  --> $DIR/mismatch-fn-trait.rs:1:18
13   |
14LL | fn take(_f: impl FnMut(i32)) {}
15   |                  ^^^^^^^^^^ required by this bound in `take`
16
17error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)`
18  --> $DIR/mismatch-fn-trait.rs:9:10
19   |
20LL |     take(f)
21   |     ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)`
22   |     |
23   |     required by a bound introduced by this call
24   |
25   = note: expected a closure taking 2 arguments, but one taking 1 argument was given
26note: required by a bound in `take`
27  --> $DIR/mismatch-fn-trait.rs:1:18
28   |
29LL | fn take(_f: impl FnMut(i32)) {}
30   |                  ^^^^^^^^^^ required by this bound in `take`
31
32error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut()`
33  --> $DIR/mismatch-fn-trait.rs:14:10
34   |
35LL |     take(f)
36   |     ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut()`
37   |     |
38   |     required by a bound introduced by this call
39   |
40   = note: expected a closure taking 0 arguments, but one taking 1 argument was given
41note: required by a bound in `take`
42  --> $DIR/mismatch-fn-trait.rs:1:18
43   |
44LL | fn take(_f: impl FnMut(i32)) {}
45   |                  ^^^^^^^^^^ required by this bound in `take`
46
47error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(i32)`
48  --> $DIR/mismatch-fn-trait.rs:19:10
49   |
50LL |     take(f)
51   |     ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(i32)`
52   |     |
53   |     required by a bound introduced by this call
54   |
55   = note: `impl FnOnce(i32)` implements `FnOnce`, but it must implement `FnMut`, which is more general
56note: required by a bound in `take`
57  --> $DIR/mismatch-fn-trait.rs:1:18
58   |
59LL | fn take(_f: impl FnMut(i32)) {}
60   |                  ^^^^^^^^^^ required by this bound in `take`
61
62error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(u32)`
63  --> $DIR/mismatch-fn-trait.rs:24:10
64   |
65LL |     take(f)
66   |     ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(u32)`
67   |     |
68   |     required by a bound introduced by this call
69   |
70   = note: `impl FnOnce(u32)` implements `FnOnce`, but it must implement `FnMut`, which is more general
71   = note: expected a closure with arguments `(u32,)`
72              found a closure with arguments `(i32,)`
73note: required by a bound in `take`
74  --> $DIR/mismatch-fn-trait.rs:1:18
75   |
76LL | fn take(_f: impl FnMut(i32)) {}
77   |                  ^^^^^^^^^^ required by this bound in `take`
78
79error: aborting due to 5 previous errors
80
81For more information about this error, try `rustc --explain E0277`.