diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-22 13:31:47 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-22 19:14:09 +0100 |
| commit | f798804cd9612daa324c93d911eae00fa1775597 (patch) | |
| tree | dd024a448d926346d00b4ccab566f3bbca01e029 | |
| parent | 60d9c2c239a401e88c118e6df34584adef4c4ebb (diff) | |
| download | rust-f798804cd9612daa324c93d911eae00fa1775597.tar.gz rust-f798804cd9612daa324c93d911eae00fa1775597.zip | |
Improve E0057 long error explanation
| -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: ``` |
