]> git.lizzy.rs Git - rust.git/commitdiff
Clean up E0593 explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 19 May 2020 11:20:33 +0000 (13:20 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 19 May 2020 11:20:33 +0000 (13:20 +0200)
src/librustc_error_codes/error_codes/E0593.md

index b32923a9e5ff96df20421275c448b5f10d6cfeac..1902d73f4d00ca2a90257c91e7a3ebbb16d906c1 100644 (file)
@@ -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!
+}
+```