@@ -45,33 +45,41 @@ help: change the closure to take multiple arguments instead of a single tuple
4545LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
4646 | ~~~~~~~~~~~~~~~
4747
48- error[E0308 ]: mismatched types
48+ error[E0593 ]: closure is expected to take 1 argument, but it takes 0 arguments
4949 --> $DIR/closure-arg-count.rs:13:5
5050 |
5151LL | f(|| panic!());
52- | ^ types differ
52+ | ^ -- takes 0 arguments
53+ | |
54+ | expected closure that takes 1 argument
5355 |
54- = note: expected trait `Fn<usize>`
55- found trait `Fn<()>`
5656note: required by a bound in `f`
5757 --> $DIR/closure-arg-count.rs:3:9
5858 |
59- LL | fn f<F: Fn<usize>>(_: F) {}
60- | ^^^^^^^^^ required by this bound in `f`
59+ LL | fn f<F: Fn<(usize,)>>(_: F) {}
60+ | ^^^^^^^^^^^^ required by this bound in `f`
61+ help: consider changing the closure to take and ignore the expected argument
62+ |
63+ LL | f(|_| panic!());
64+ | ~~~
6165
62- error[E0308 ]: mismatched types
66+ error[E0593 ]: closure is expected to take 1 argument, but it takes 0 arguments
6367 --> $DIR/closure-arg-count.rs:15:5
6468 |
6569LL | f( move || panic!());
66- | ^ types differ
70+ | ^ ---------- takes 0 arguments
71+ | |
72+ | expected closure that takes 1 argument
6773 |
68- = note: expected trait `Fn<usize>`
69- found trait `Fn<()>`
7074note: required by a bound in `f`
7175 --> $DIR/closure-arg-count.rs:3:9
7276 |
73- LL | fn f<F: Fn<usize>>(_: F) {}
74- | ^^^^^^^^^ required by this bound in `f`
77+ LL | fn f<F: Fn<(usize,)>>(_: F) {}
78+ | ^^^^^^^^^^^^ required by this bound in `f`
79+ help: consider changing the closure to take and ignore the expected argument
80+ |
81+ LL | f( move |_| panic!());
82+ | ~~~
7583
7684error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
7785 --> $DIR/closure-arg-count.rs:18:53
@@ -190,5 +198,4 @@ LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
190198
191199error: aborting due to 14 previous errors
192200
193- Some errors have detailed explanations: E0308, E0593.
194- For more information about an error, try `rustc --explain E0308`.
201+ For more information about this error, try `rustc --explain E0593`.
0 commit comments