-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: variable should be placed in scope earlier #78115
Comments
Likely cause: #75213 |
MCVE: fn main() {
async {
match foo {
Foo { a } | Foo { a } if true => {}
}
}
} The ICE occurs (inside async blocks or functions) if you're using a match guard and binding the same variable name in both sides of an "or" in a match pattern. |
Assigning |
This ICE is caused here: rust/compiler/rustc_typeck/src/check/generator_interior.rs Lines 371 to 374 in a85e949
According to the docs:
As we're using a set and a vec in parallel, the ID is pushed twice but stored "only once". Then, we remove it once, and it still exists in the vec but not in the set: rust/compiler/rustc_typeck/src/check/generator_interior.rs Lines 252 to 257 in a85e949
|
Code
From #78115 (comment):
Meta
It fails at version:
It worked before at version:
Error output
Backtrace
The text was updated successfully, but these errors were encountered: