@@ -14,7 +14,7 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
14
14
| |
15
15
| expected closure that takes 2 arguments
16
16
17
- error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
17
+ error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
18
18
--> $DIR/closure-arg-count.rs:19:15
19
19
|
20
20
19 | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
@@ -39,9 +39,9 @@ help: change the closure to take multiple arguments instead of a single tuple
39
39
| ^^^^^^^^^^^^^^^
40
40
41
41
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
42
- --> $DIR/closure-arg-count.rs:21 :5
42
+ --> $DIR/closure-arg-count.rs:23 :5
43
43
|
44
- 21 | f(|| panic!());
44
+ 23 | f(|| panic!());
45
45
| ^ -- takes 0 arguments
46
46
| |
47
47
| expected closure that takes 1 argument
@@ -52,45 +52,53 @@ note: required by `f`
52
52
13 | fn f<F: Fn<usize>>(_: F) {}
53
53
| ^^^^^^^^^^^^^^^^^^^^^^^^
54
54
55
- error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
56
- --> $DIR/closure-arg-count.rs:24 :53
55
+ error[E0593]: closure is expected to take a single 2- tuple as argument, but it takes 2 distinct arguments
56
+ --> $DIR/closure-arg-count.rs:26 :53
57
57
|
58
- 24 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
59
- | ^^^ ------ help: consider changing the closure to accept a tuple: `|(i, x)|`
58
+ 26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
59
+ | ^^^ ------ takes 2 distinct arguments
60
60
| |
61
- | expected closure that takes a single tuple as argument
61
+ | expected closure that takes a single 2-tuple as argument
62
+ help: change the closure to accept a tuple instead of individual arguments
63
+ |
64
+ 26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
65
+ | ^^^^^^^^
62
66
63
- error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
64
- --> $DIR/closure-arg-count.rs:26 :53
67
+ error[E0593]: closure is expected to take a single 2- tuple as argument, but it takes 2 distinct arguments
68
+ --> $DIR/closure-arg-count.rs:28 :53
65
69
|
66
- 26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
67
- | ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
70
+ 28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
71
+ | ^^^ ------------- takes 2 distinct arguments
68
72
| |
69
- | expected closure that takes a single tuple as argument
73
+ | expected closure that takes a single 2-tuple as argument
74
+ help: change the closure to accept a tuple instead of individual arguments
75
+ |
76
+ 28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
77
+ | ^^^^^^^^
70
78
71
79
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
72
- --> $DIR/closure-arg-count.rs:28 :53
80
+ --> $DIR/closure-arg-count.rs:30 :53
73
81
|
74
- 28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
82
+ 30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
75
83
| ^^^ --------- takes 3 distinct arguments
76
84
| |
77
85
| expected closure that takes a single 2-tuple as argument
78
86
79
87
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
80
- --> $DIR/closure-arg-count.rs:30 :53
88
+ --> $DIR/closure-arg-count.rs:32 :53
81
89
|
82
- 30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
90
+ 32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
83
91
| ^^^ expected function that takes a single 2-tuple as argument
84
92
...
85
- 37 | fn foo() {}
93
+ 41 | fn foo() {}
86
94
| -------- takes 0 arguments
87
95
88
96
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
89
- --> $DIR/closure-arg-count.rs:33 :53
97
+ --> $DIR/closure-arg-count.rs:35 :53
90
98
|
91
- 32 | let bar = |i, x, y| i;
99
+ 34 | let bar = |i, x, y| i;
92
100
| --------- takes 3 distinct arguments
93
- 33 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
101
+ 35 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
94
102
| ^^^ expected closure that takes a single 2-tuple as argument
95
103
96
104
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
0 commit comments