1 error[E0277]: `fn() -> impl Future<Output = ()> {foo}` is not a future
2 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:9
5 | --- ^^^ `fn() -> impl Future<Output = ()> {foo}` is not a future
7 | required by a bound introduced by this call
9 = help: the trait `Future` is not implemented for fn item `fn() -> impl Future<Output = ()> {foo}`
10 = note: fn() -> impl Future<Output = ()> {foo} must be a future or must implement `IntoFuture` to be awaited
11 note: required by a bound in `bar`
12 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
14 LL | fn bar(f: impl Future<Output=()>) {}
15 | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
16 help: use parentheses to call this function
21 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
22 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
24 LL | bar(async_closure);
25 | --- ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]` is not a future
27 | required by a bound introduced by this call
29 = 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]`
30 = 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
31 note: required by a bound in `bar`
32 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
34 LL | fn bar(f: impl Future<Output=()>) {}
35 | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
36 help: use parentheses to call this closure
38 LL | bar(async_closure());
41 error: aborting due to 2 previous errors
43 For more information about this error, try `rustc --explain E0277`.