@@ -45,41 +45,33 @@ help: change the closure to take multiple arguments instead of a single tuple
45
45
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
46
46
| ~~~~~~~~~~~~~~~
47
47
48
- error[E0593 ]: closure is expected to take 1 argument, but it takes 0 arguments
48
+ error[E0308 ]: mismatched types
49
49
--> $DIR/closure-arg-count.rs:13:5
50
50
|
51
51
LL | f(|| panic!());
52
- | ^ -- takes 0 arguments
53
- | |
54
- | expected closure that takes 1 argument
52
+ | ^ types differ
55
53
|
54
+ = note: expected trait `Fn<usize>`
55
+ found trait `Fn<()>`
56
56
note: required by a bound in `f`
57
57
--> $DIR/closure-arg-count.rs:3:9
58
58
|
59
59
LL | fn f<F: Fn<usize>>(_: F) {}
60
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
- | ~~~
65
61
66
- error[E0593 ]: closure is expected to take 1 argument, but it takes 0 arguments
62
+ error[E0308 ]: mismatched types
67
63
--> $DIR/closure-arg-count.rs:15:5
68
64
|
69
65
LL | f( move || panic!());
70
- | ^ ---------- takes 0 arguments
71
- | |
72
- | expected closure that takes 1 argument
66
+ | ^ types differ
73
67
|
68
+ = note: expected trait `Fn<usize>`
69
+ found trait `Fn<()>`
74
70
note: required by a bound in `f`
75
71
--> $DIR/closure-arg-count.rs:3:9
76
72
|
77
73
LL | fn f<F: Fn<usize>>(_: F) {}
78
74
| ^^^^^^^^^ 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
- | ~~~
83
75
84
76
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
85
77
--> $DIR/closure-arg-count.rs:18:53
@@ -198,4 +190,5 @@ LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
198
190
199
191
error: aborting due to 14 previous errors
200
192
201
- For more information about this error, try `rustc --explain E0593`.
193
+ Some errors have detailed explanations: E0308, E0593.
194
+ For more information about an error, try `rustc --explain E0308`.
0 commit comments