File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- When invoking closures or other implementations of the function traits ` Fn ` ,
2
- ` FnMut ` or ` FnOnce ` using call notation, the number of parameters passed to the
3
- function must match its definition.
1
+ An invalid number of arguments was given when calling a closure.
4
2
5
- An example using a closure :
3
+ Erroneous code example :
6
4
7
5
``` compile_fail,E0057
8
6
let f = |x| x * 3;
@@ -11,6 +9,10 @@ let b = f(4); // this works!
11
9
let c = f(2, 3); // invalid, too many parameters
12
10
```
13
11
12
+ When invoking closures or other implementations of the function traits ` Fn ` ,
13
+ ` FnMut ` or ` FnOnce ` using call notation, the number of parameters passed to the
14
+ function must match its definition.
15
+
14
16
A generic function must be treated similarly:
15
17
16
18
```
You can’t perform that action at this time.
0 commit comments