You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
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`
6
+
|
7
+
= help: the trait `Try` is not implemented for `impl Future`
8
+
= note: required by `branch`
9
+
10
+
error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`)
11
+
--> $DIR/issue-84841.rs:9:11
12
+
|
13
+
LL | async fn foo() {
14
+
| ________________-
15
+
LL | | // Adding an .await here avoids the ICE
16
+
LL | | test()?;
17
+
| | ^ cannot use the `?` operator in an async function that returns `()`
18
+
LL | |
19
+
LL | |
20
+
LL | | }
21
+
| |_- this function should return `Result` or `Option` to accept `?`
22
+
|
23
+
= help: the trait `FromResidual<_>` is not implemented for `()`
24
+
= note: required by `from_residual`
25
+
26
+
error: aborting due to 2 previous errors
27
+
28
+
For more information about this error, try `rustc --explain E0277`.
0 commit comments