]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/closure-arg-count.stderr
Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
[rust.git] / src / test / ui / mismatched_types / closure-arg-count.stderr
1 error[E0593]: closure takes 0 arguments but 2 arguments are required
2   --> $DIR/closure-arg-count.rs:12:15
3    |
4 12 |     [1, 2, 3].sort_by(|| panic!());
5    |               ^^^^^^^ ----------- takes 0 arguments
6    |               |
7    |               expected closure that takes 2 arguments
8
9 error[E0593]: closure takes 1 argument but 2 arguments are required
10   --> $DIR/closure-arg-count.rs:13:15
11    |
12 13 |     [1, 2, 3].sort_by(|tuple| panic!());
13    |               ^^^^^^^ ---------------- takes 1 argument
14    |               |
15    |               expected closure that takes 2 arguments
16
17 error[E0308]: mismatched types
18   --> $DIR/closure-arg-count.rs:14:24
19    |
20 14 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
21    |                        ^^^^^^^^^^^^^^^ expected &{integer}, found tuple
22    |
23    = note: expected type `&{integer}`
24               found type `(_, _)`
25
26 error[E0593]: closure takes 1 argument but 2 arguments are required
27   --> $DIR/closure-arg-count.rs:14:15
28    |
29 14 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
30    |               ^^^^^^^ -------------------------- takes 1 argument
31    |               |
32    |               expected closure that takes 2 arguments
33
34 error: aborting due to previous error(s)
35