diff options
| author | Ralf Jung <post@ralfj.de> | 2020-05-22 16:58:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-22 16:58:29 +0200 |
| commit | f7ed13b6a50cb7994dc6fa2f967219a9c7a714ee (patch) | |
| tree | e6d468bb1dffb57545e388bf77ce2ea45d3b7e94 /src/librustc_error_codes/error_codes | |
| parent | 02eb002ee37a75e3998841f1de64a0a115256800 (diff) | |
| parent | 56c494a1487e7fdea07c641e5a182cffba1d15c0 (diff) | |
| download | rust-f7ed13b6a50cb7994dc6fa2f967219a9c7a714ee.tar.gz rust-f7ed13b6a50cb7994dc6fa2f967219a9c7a714ee.zip | |
Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation r? @Dylan-DPC
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0593.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0593.md b/src/librustc_error_codes/error_codes/E0593.md index b32923a9e5f..1902d73f4d0 100644 --- a/src/librustc_error_codes/error_codes/E0593.md +++ b/src/librustc_error_codes/error_codes/E0593.md @@ -11,3 +11,14 @@ fn main() { foo(|y| { }); } ``` + +You have to provide the same number of arguments as expected by the `Fn`-based +type. So to fix the previous example, we need to remove the `y` argument: + +``` +fn foo<F: Fn()>(x: F) { } + +fn main() { + foo(|| { }); // ok! +} +``` |
