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