]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
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()?; | |
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 | |
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 `()` | |
136023e0 XL |
23 | |
24 | error: aborting due to 2 previous errors | |
25 | ||
26 | For more information about this error, try `rustc --explain E0277`. |