2021-11-16 16:16:23 -08:00
|
|
|
error[E0277]: `fn() -> impl Future<Output = ()> {foo}` is not a future
|
2024-11-06 17:53:59 +00:00
|
|
|
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:9
|
2019-08-24 14:45:03 -07:00
|
|
|
|
|
|
|
|
|
LL | bar(foo);
|
2021-11-16 16:16:23 -08:00
|
|
|
| --- ^^^ `fn() -> impl Future<Output = ()> {foo}` is not a future
|
2021-09-07 11:30:53 +00:00
|
|
|
| |
|
|
|
|
|
| required by a bound introduced by this call
|
2020-03-11 20:38:21 -07:00
|
|
|
|
|
2022-08-29 16:53:36 +03:00
|
|
|
= help: the trait `Future` is not implemented for fn item `fn() -> impl Future<Output = ()> {foo}`
|
2021-07-31 09:26:55 -07:00
|
|
|
note: required by a bound in `bar`
|
2024-11-06 17:53:59 +00:00
|
|
|
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:6:16
|
2021-07-31 09:26:55 -07:00
|
|
|
|
|
|
|
|
|
LL | fn bar(f: impl Future<Output=()>) {}
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
|
2022-10-09 22:25:52 +00:00
|
|
|
help: use parentheses to call this function
|
2020-03-11 20:38:21 -07:00
|
|
|
|
|
|
|
|
|
LL | bar(foo());
|
2021-06-21 19:07:19 -07:00
|
|
|
| ++
|
2019-08-24 14:45:03 -07:00
|
|
|
|
2024-11-06 17:53:59 +00:00
|
|
|
error[E0277]: `{async closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:25: 10:33}` is not a future
|
|
|
|
|
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:9
|
2019-11-08 18:04:05 -08:00
|
|
|
|
|
|
|
|
|
LL | bar(async_closure);
|
2024-11-06 17:53:59 +00:00
|
|
|
| --- ^^^^^^^^^^^^^ `{async closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:25: 10:33}` is not a future
|
2021-09-07 11:30:53 +00:00
|
|
|
| |
|
|
|
|
|
| required by a bound introduced by this call
|
2020-03-11 20:38:21 -07:00
|
|
|
|
|
2024-11-06 17:53:59 +00:00
|
|
|
= help: the trait `Future` is not implemented for `{async closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:25: 10:33}`
|
2021-07-31 09:26:55 -07:00
|
|
|
note: required by a bound in `bar`
|
2024-11-06 17:53:59 +00:00
|
|
|
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:6:16
|
2021-07-31 09:26:55 -07:00
|
|
|
|
|
|
|
|
|
LL | fn bar(f: impl Future<Output=()>) {}
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
|
2024-11-02 03:53:59 +00:00
|
|
|
help: use parentheses to call this closure
|
|
|
|
|
|
|
|
|
|
|
LL | bar(async_closure());
|
|
|
|
|
| ++
|
2019-11-08 18:04:05 -08:00
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2019-08-24 14:45:03 -07:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|