diff options
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0057.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0057.md b/src/librustc_error_codes/error_codes/E0057.md index e11c07f835a..bb5e4b48d2d 100644 --- a/src/librustc_error_codes/error_codes/E0057.md +++ b/src/librustc_error_codes/error_codes/E0057.md @@ -1,8 +1,6 @@ -When invoking closures or other implementations of the function traits `Fn`, -`FnMut` or `FnOnce` using call notation, the number of parameters passed to the -function must match its definition. +An invalid number of arguments was given when calling a closure. -An example using a closure: +Erroneous code example: ```compile_fail,E0057 let f = |x| x * 3; @@ -11,6 +9,10 @@ let b = f(4); // this works! let c = f(2, 3); // invalid, too many parameters ``` +When invoking closures or other implementations of the function traits `Fn`, +`FnMut` or `FnOnce` using call notation, the number of parameters passed to the +function must match its definition. + A generic function must be treated similarly: ``` |
