| |
| expected closure that takes 2 arguments
-error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
+error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
--> $DIR/closure-arg-count.rs:19:15
|
19 | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
| ^^^^^^^^^^^^^^^
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
- --> $DIR/closure-arg-count.rs:21:5
+ --> $DIR/closure-arg-count.rs:23:5
|
-21 | f(|| panic!());
+23 | f(|| panic!());
| ^ -- takes 0 arguments
| |
| expected closure that takes 1 argument
13 | fn f<F: Fn<usize>>(_: F) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
- --> $DIR/closure-arg-count.rs:24:53
+error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
+ --> $DIR/closure-arg-count.rs:26:53
|
-24 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
- | ^^^ ------ help: consider changing the closure to accept a tuple: `|(i, x)|`
+26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
+ | ^^^ ------ takes 2 distinct arguments
| |
- | expected closure that takes a single tuple as argument
+ | expected closure that takes a single 2-tuple as argument
+help: change the closure to accept a tuple instead of individual arguments
+ |
+26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
+ | ^^^^^^^^
-error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
- --> $DIR/closure-arg-count.rs:26:53
+error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
+ --> $DIR/closure-arg-count.rs:28:53
|
-26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
- | ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
+28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
+ | ^^^ ------------- takes 2 distinct arguments
| |
- | expected closure that takes a single tuple as argument
+ | expected closure that takes a single 2-tuple as argument
+help: change the closure to accept a tuple instead of individual arguments
+ |
+28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
+ | ^^^^^^^^
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
- --> $DIR/closure-arg-count.rs:28:53
+ --> $DIR/closure-arg-count.rs:30:53
|
-28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
+30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
| ^^^ --------- takes 3 distinct arguments
| |
| expected closure that takes a single 2-tuple as argument
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
- --> $DIR/closure-arg-count.rs:30:53
+ --> $DIR/closure-arg-count.rs:32:53
|
-30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
+32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
| ^^^ expected function that takes a single 2-tuple as argument
...
-37 | fn foo() {}
+41 | fn foo() {}
| -------- takes 0 arguments
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
- --> $DIR/closure-arg-count.rs:33:53
+ --> $DIR/closure-arg-count.rs:35:53
|
-32 | let bar = |i, x, y| i;
+34 | let bar = |i, x, y| i;
| --------- takes 3 distinct arguments
-33 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
+35 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
| ^^^ expected closure that takes a single 2-tuple as argument
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments