Skip to content

Commit f798804

Browse files
Improve E0057 long error explanation
1 parent 60d9c2c commit f798804

File tree

1 file changed

+6
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+6
-4
lines changed

src/librustc_error_codes/error_codes/E0057.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
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.
42

5-
An example using a closure:
3+
Erroneous code example:
64

75
```compile_fail,E0057
86
let f = |x| x * 3;
@@ -11,6 +9,10 @@ let b = f(4); // this works!
119
let c = f(2, 3); // invalid, too many parameters
1210
```
1311

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+
1416
A generic function must be treated similarly:
1517

1618
```

0 commit comments

Comments
 (0)