When possible, suggest fn call
This commit is contained in:
parent
5976e0eecf
commit
2fbd6927a5
8 changed files with 64 additions and 32 deletions
|
|
@ -5,9 +5,10 @@ LL | fn bar(f: impl Future<Output=()>) {}
|
|||
| --------------------------------- required by `bar`
|
||||
...
|
||||
LL | bar(foo);
|
||||
| ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
|
||||
|
|
||||
= help: use parentheses to call the function: `foo()`
|
||||
| ^^^
|
||||
| |
|
||||
| the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
|
||||
| help: use parentheses to call the function: `foo()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ LL | fn bar(f: impl T<O=()>) {}
|
|||
| ----------------------- required by `bar`
|
||||
...
|
||||
LL | bar(foo);
|
||||
| ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}`
|
||||
|
|
||||
= help: use parentheses to call the function: `foo()`
|
||||
| ^^^
|
||||
| |
|
||||
| the trait `T` is not implemented for `fn() -> impl T {foo}`
|
||||
| help: use parentheses to call the function: `foo()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue