@@ -60,8 +60,26 @@ help: consider changing the closure to take and ignore the expected argument
6060LL | f(|_| panic!());
6161 | ^^^
6262
63+ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
64+ --> $DIR/closure-arg-count.rs:25:5
65+ |
66+ LL | f(move || panic!());
67+ | ^ ------- takes 0 arguments
68+ | |
69+ | expected closure that takes 1 argument
70+ |
71+ note: required by `f`
72+ --> $DIR/closure-arg-count.rs:13:1
73+ |
74+ LL | fn f<F: Fn<usize>>(_: F) {}
75+ | ^^^^^^^^^^^^^^^^^^^^^^^^
76+ help: consider changing the closure to take and ignore the expected argument
77+ |
78+ LL | f(move|_| panic!());
79+ | ^^^
80+
6381error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
64- --> $DIR/closure-arg-count.rs:26 :53
82+ --> $DIR/closure-arg-count.rs:28 :53
6583 |
6684LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
6785 | ^^^ ------ takes 2 distinct arguments
@@ -73,7 +91,7 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
7391 | ^^^^^^^^
7492
7593error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
76- --> $DIR/closure-arg-count.rs:28 :53
94+ --> $DIR/closure-arg-count.rs:30 :53
7795 |
7896LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
7997 | ^^^ ------------- takes 2 distinct arguments
@@ -85,15 +103,15 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
85103 | ^^^^^^^^
86104
87105error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
88- --> $DIR/closure-arg-count.rs:30 :53
106+ --> $DIR/closure-arg-count.rs:32 :53
89107 |
90108LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
91109 | ^^^ --------- takes 3 distinct arguments
92110 | |
93111 | expected closure that takes a single 2-tuple as argument
94112
95113error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
96- --> $DIR/closure-arg-count.rs:32 :53
114+ --> $DIR/closure-arg-count.rs:34 :53
97115 |
98116LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
99117 | ^^^ expected function that takes a single 2-tuple as argument
@@ -102,15 +120,15 @@ LL | fn foo() {}
102120 | -------- takes 0 arguments
103121
104122error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
105- --> $DIR/closure-arg-count.rs:35 :53
123+ --> $DIR/closure-arg-count.rs:37 :53
106124 |
107125LL | let bar = |i, x, y| i;
108126 | --------- takes 3 distinct arguments
109127LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
110128 | ^^^ expected closure that takes a single 2-tuple as argument
111129
112130error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
113- --> $DIR/closure-arg-count.rs:37 :53
131+ --> $DIR/closure-arg-count.rs:39 :53
114132 |
115133LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(qux);
116134 | ^^^ expected function that takes a single 2-tuple as argument
@@ -119,13 +137,13 @@ LL | fn qux(x: usize, y: usize) {}
119137 | -------------------------- takes 2 distinct arguments
120138
121139error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
122- --> $DIR/closure-arg-count.rs:40 :41
140+ --> $DIR/closure-arg-count.rs:42 :41
123141 |
124142LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
125143 | ^^^ expected function that takes 1 argument
126144
127145error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
128- --> $DIR/closure-arg-count.rs:43 :5
146+ --> $DIR/closure-arg-count.rs:45 :5
129147 |
130148LL | call(Foo);
131149 | ^^^^ expected function that takes 0 arguments
@@ -134,11 +152,11 @@ LL | struct Foo(u8);
134152 | --------------- takes 1 argument
135153 |
136154note: required by `call`
137- --> $DIR/closure-arg-count.rs:50 :1
155+ --> $DIR/closure-arg-count.rs:52 :1
138156 |
139157LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
140158 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141159
142- error: aborting due to 13 previous errors
160+ error: aborting due to 14 previous errors
143161
144162For more information about this error, try `rustc --explain E0593`.
0 commit comments