When possible, suggest fn call

This commit is contained in:
Esteban Küber 2019-09-16 15:54:31 -07:00
parent 5976e0eecf
commit 2fbd6927a5
8 changed files with 64 additions and 32 deletions

View file

@ -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

View file

@ -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