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