Skip to content

Commit 56c494a

Browse files
Clean up E0593 explanation
1 parent 97f3eee commit 56c494a

File tree

1 file changed

+11
-0
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+11
-0
lines changed

src/librustc_error_codes/error_codes/E0593.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,14 @@ fn main() {
1111
foo(|y| { });
1212
}
1313
```
14+
15+
You have to provide the same number of arguments as expected by the `Fn`-based
16+
type. So to fix the previous example, we need to remove the `y` argument:
17+
18+
```
19+
fn foo<F: Fn()>(x: F) { }
20+
21+
fn main() {
22+
foo(|| { }); // ok!
23+
}
24+
```

0 commit comments

Comments
 (0)