Skip to content

Commit f7ed13b

Browse files
authored
Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation r? @Dylan-DPC
2 parents 02eb002 + 56c494a commit f7ed13b

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

+11
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)