]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/issue-84841.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / async-await / issue-84841.stderr
CommitLineData
136023e0
XL
1error[E0277]: the `?` operator can only be applied to values that implement `Try`
2 --> $DIR/issue-84841.rs:9:5
3 |
4LL | test()?;
3c0e092e 5 | ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>`
136023e0 6 |
3c0e092e 7 = help: the trait `Try` is not implemented for `impl Future<Output = ()>`
136023e0
XL
8
9error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
10 --> $DIR/issue-84841.rs:9:11
11 |
12LL | async fn foo() {
13 | ________________-
14LL | | // Adding an .await here avoids the ICE
15LL | | test()?;
16 | | ^ cannot use the `?` operator in an async function that returns `()`
17LL | |
18LL | |
19LL | | }
20 | |_- this function should return `Result` or `Option` to accept `?`
21 |
22 = help: the trait `FromResidual<_>` is not implemented for `()`
136023e0
XL
23
24error: aborting due to 2 previous errors
25
26For more information about this error, try `rustc --explain E0277`.