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