mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation r? @Dylan-DPC
This commit is contained in:
commit
f7ed13b6a5
@ -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…
Reference in New Issue
Block a user