1 error[E0277]: `fn() -> impl Future {foo}` is not a future
2 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:9
5 | --- consider calling this function
7 LL | fn bar(f: impl Future<Output=()>) {}
8 | ----------------- required by this bound in `bar`
11 | ^^^ `fn() -> impl Future {foo}` is not a future
13 = help: the trait `Future` is not implemented for `fn() -> impl Future {foo}`
14 help: use parentheses to call the function
19 error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
20 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
22 LL | fn bar(f: impl Future<Output=()>) {}
23 | ----------------- required by this bound in `bar`
25 LL | let async_closure = async || ();
26 | -------- consider calling this closure
27 LL | bar(async_closure);
28 | ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
30 = help: the trait `Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]`
31 help: use parentheses to call the closure
33 LL | bar(async_closure());
36 error: aborting due to 2 previous errors
38 For more information about this error, try `rustc --explain E0277`.