]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-84841.stderr
Rollup merge of #107065 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / ui / async-await / issue-84841.stderr
1 error[E0277]: the `?` operator can only be applied to values that implement `Try`
2   --> $DIR/issue-84841.rs:9:5
3    |
4 LL |     test()?;
5    |     ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>`
6    |
7    = help: the trait `Try` is not implemented for `impl Future<Output = ()>`
8
9 error[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    |
12 LL |   async fn foo() {
13    |  ________________-
14 LL | |     // Adding an .await here avoids the ICE
15 LL | |     test()?;
16    | |           ^ cannot use the `?` operator in an async function that returns `()`
17 LL | |
18 LL | |
19 LL | | }
20    | |_- this function should return `Result` or `Option` to accept `?`
21    |
22    = help: the trait `FromResidual<_>` is not implemented for `()`
23
24 error: aborting due to 2 previous errors
25
26 For more information about this error, try `rustc --explain E0277`.