-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE in debug generation with match guard. #34569
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
Comments
Building the project at the specified commit fails with
The branch dpms seems to be deleted for the repository in question and referenced commit does not exist anymore. I tried using master branch but alas. |
@nagisa my bad, forgot to |
Minimised: fn main() {
match 0 {
e if (|| { e == 0 })() => unimplemented!(),
1 => unimplemented!(),
_ => unimplemented!()
}
} On nightly, when compiled with debug info
The problem seems to be the use of variable bound in match arm (the Works with MIR (-Z orbit). |
Ah it's a regression, that's why I couldn't come up with a reduced test-case, didn't realize I was using stable to compile the test-case 🐼 |
Thanks for the report and the reduced test case. I'll look into it. |
1.11 is now beta |
I was able to reproduce this and it is very strange that there are two |
For some reason (which I haven't looked into yet) |
OK, I can confirm that prevent double-translation of closures solves this problem. @rust-lang/compiler Does anybody knowledgeable about the non-MIR match code know whether it is legitimate that the guard is translated twice? |
trans: Make sure that closures only get translated once. Fixes #34569.
This is the full project that causes that failure, make sure to use that commit.
The culprit line is here.
Inside a match:
Results in:
If I change that to:
Then it compiles.
I tried to come up with a reduced test case but failed, so sorry for the full project as test case.
The text was updated successfully, but these errors were encountered: