Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation r? @Dylan-DPC
This commit is contained in:
commit
f7ed13b6a5
1 changed files with 11 additions and 0 deletions
|
|
@ -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!
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue