-
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 when pattern matching an enum on a let binding within a closure, with --edition 2021
#95271
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
saiintbrisson
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Mar 24, 2022
saiintbrisson
changed the title
ICE when pattern matching a enum within a closure
ICE when pattern matching an enum within a closure
Mar 24, 2022
I'm willing to work on it if it turns out to be a simple fix, hints are appreciated! |
Does this still crash on nightly? I was not able to repro with |
It does here, same code as above. But the backtrace has changed.
Backtrace
|
Ah I missed the |
matthiaskrgr
changed the title
ICE when pattern matching an enum within a closure
ICE when pattern matching an enum within a closure, with Mar 24, 2022
--edition 2021
saiintbrisson
changed the title
ICE when pattern matching an enum within a closure, with
ICE when pattern matching an enum on a let binding within a closure, with Mar 24, 2022
--edition 2021
--edition 2021
This was referenced Apr 25, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jun 7, 2022
…-aman Fix precise field capture of univariant enums When constructing a MIR from a THIR field expression, introduce an additional downcast projection before accessing a field of an enum. When rebasing a place builder on top of a captured place, account for the fact that a single HIR enum field projection corresponds to two MIR projection elements: a downcast element and a field element. Fixes rust-lang#95271. Fixes rust-lang#96299. Fixes rust-lang#96512. Fixes rust-lang#97378. r? `@nikomatsakis` `@arora-aman`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was messing around with the
async_trait
crate and an ICE was raised when I tried to pattern match an enum in the function parameter. I narrowed it down to trying to pattern match a variable that exists outside the scope from within a closure.Code
Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3465e1787d6792e07772f31154877280
Meta
Present in all three channels, beta, nightly and stable. Only present on 2021 edition.
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: