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
Auto merge of #86866 - nikomatsakis:issue-84841, r=oli-obk
Hack: Ignore inference variables in certain queries
Fixes#84841Fixes#86753
Some queries are not built to accept types with inference variables, which can lead to ICEs. These queries probably ought to be converted to canonical form, but as a quick workaround, we can return conservative results in the case that inference variables are found.
We should file a follow-up issue (and update the FIXMEs...) to do the proper refactoring.
cc `@arora-aman`
r? `@oli-obk`
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