]> git.lizzy.rs Git - rust.git/blob - tests/ui/trait-bounds/mismatch-fn-trait.stderr
Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkov
[rust.git] / tests / ui / trait-bounds / mismatch-fn-trait.stderr
1 error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(u32)`
2   --> $DIR/mismatch-fn-trait.rs:4:10
3    |
4 LL |     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,)`
11 note: required by a bound in `take`
12   --> $DIR/mismatch-fn-trait.rs:1:18
13    |
14 LL | fn take(_f: impl FnMut(i32)) {}
15    |                  ^^^^^^^^^^ required by this bound in `take`
16
17 error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)`
18   --> $DIR/mismatch-fn-trait.rs:9:10
19    |
20 LL |     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
26 note: required by a bound in `take`
27   --> $DIR/mismatch-fn-trait.rs:1:18
28    |
29 LL | fn take(_f: impl FnMut(i32)) {}
30    |                  ^^^^^^^^^^ required by this bound in `take`
31
32 error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut()`
33   --> $DIR/mismatch-fn-trait.rs:14:10
34    |
35 LL |     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
41 note: required by a bound in `take`
42   --> $DIR/mismatch-fn-trait.rs:1:18
43    |
44 LL | fn take(_f: impl FnMut(i32)) {}
45    |                  ^^^^^^^^^^ required by this bound in `take`
46
47 error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(i32)`
48   --> $DIR/mismatch-fn-trait.rs:19:10
49    |
50 LL |     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
56 note: required by a bound in `take`
57   --> $DIR/mismatch-fn-trait.rs:1:18
58    |
59 LL | fn take(_f: impl FnMut(i32)) {}
60    |                  ^^^^^^^^^^ required by this bound in `take`
61
62 error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(u32)`
63   --> $DIR/mismatch-fn-trait.rs:24:10
64    |
65 LL |     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,)`
73 note: required by a bound in `take`
74   --> $DIR/mismatch-fn-trait.rs:1:18
75    |
76 LL | fn take(_f: impl FnMut(i32)) {}
77    |                  ^^^^^^^^^^ required by this bound in `take`
78
79 error: aborting due to 5 previous errors
80
81 For more information about this error, try `rustc --explain E0277`.