From 56c494a1487e7fdea07c641e5a182cffba1d15c0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 19 May 2020 13:20:33 +0200 Subject: [PATCH] Clean up E0593 explanation --- src/librustc_error_codes/error_codes/E0593.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/librustc_error_codes/error_codes/E0593.md b/src/librustc_error_codes/error_codes/E0593.md index b32923a9e5ff9..1902d73f4d00c 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(x: F) { } + +fn main() { + foo(|| { }); // ok! +} +```