]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / suggestions / async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
CommitLineData
3c0e092e 1error[E0277]: `fn() -> impl Future<Output = ()> {foo}` is not a future
60c5eb7d 2 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:9
e1599b0c 3 |
60c5eb7d
XL
4LL | async fn foo() {}
5 | --- consider calling this function
e1599b0c
XL
6...
7LL | bar(foo);
3c0e092e 8 | --- ^^^ `fn() -> impl Future<Output = ()> {foo}` is not a future
c295e0f8
XL
9 | |
10 | required by a bound introduced by this call
ba9703b0 11 |
f2b60f7d 12 = help: the trait `Future` is not implemented for fn item `fn() -> impl Future<Output = ()> {foo}`
a2a8927a 13 = note: fn() -> impl Future<Output = ()> {foo} must be a future or must implement `IntoFuture` to be awaited
94222f64
XL
14note: required by a bound in `bar`
15 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
16 |
17LL | fn bar(f: impl Future<Output=()>) {}
18 | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
ba9703b0
XL
19help: use parentheses to call the function
20 |
21LL | bar(foo());
94222f64 22 | ++
e1599b0c 23
064997fb 24error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]` is not a future
60c5eb7d
XL
25 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
26 |
60c5eb7d
XL
27LL | let async_closure = async || ();
28 | -------- consider calling this closure
29LL | bar(async_closure);
064997fb 30 | --- ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]` is not a future
c295e0f8
XL
31 | |
32 | required by a bound introduced by this call
ba9703b0 33 |
f2b60f7d 34 = 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]`
064997fb 35 = 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
94222f64
XL
36note: required by a bound in `bar`
37 --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
38 |
39LL | fn bar(f: impl Future<Output=()>) {}
40 | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
ba9703b0
XL
41help: use parentheses to call the closure
42 |
43LL | bar(async_closure());
94222f64 44 | ++
60c5eb7d
XL
45
46error: aborting due to 2 previous errors
e1599b0c
XL
47
48For more information about this error, try `rustc --explain E0277`.