]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
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
3    |
4 LL |     bar(foo);
5    |     --- ^^^ `fn() -> impl Future<Output = ()> {foo}` is not a future
6    |     |
7    |     required by a bound introduced by this call
8    |
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
13    |
14 LL | fn bar(f: impl Future<Output=()>) {}
15    |                ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
16 help: use parentheses to call this function
17    |
18 LL |     bar(foo());
19    |            ++
20
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
23    |
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
26    |     |
27    |     required by a bound introduced by this call
28    |
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
33    |
34 LL | fn bar(f: impl Future<Output=()>) {}
35    |                ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
36 help: use parentheses to call this closure
37    |
38 LL |     bar(async_closure());
39    |                      ++
40
41 error: aborting due to 2 previous errors
42
43 For more information about this error, try `rustc --explain E0277`.