-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 on loop {|_: [_; continue]| {}} #51761
Comments
Counterintuitively, this should probably compile successfully. It's not surprising that it's not working, though: it's a really weird edge case. I'll look into it. |
I don't think it should compile successfully. The |
I feel perhaps control-flow should just not be allowed inside type-level constants like this. That seems like the most logical decision. In which case, we should just add a new error for this. Edit: Just saw @rkruppe's comment. I agree, though I'm not sure there's precedent for that or not? Is there an existing error we can make us of? |
As I said, I believe this is a plain old "continue outside of loop" errors. The |
What about the Rewritting it using a fn main() {
loop {
|_: [_; break] | {}
}
} |
@DutchGhost that's fixed by @varkor 's PR #51731 . The fix is not in nightly yet, not even merged. I've applied the PR locally in order to test whether the It would probably make sense if @varkor would also fix the break version right away. |
…=estebank Fix various issues with control-flow statements inside anonymous constants Fixes rust-lang#51761. Fixes rust-lang#51963 (and the host of other reported issues there). (Might be easiest to review per commit, as they should be standalone.) r? @estebank
The following code ICEs on
nightly
,stable
andbeta
:The ICE message is:
As of filing this bug, PR #51731 does not fix it. If I apply it, I'm getting:
The text was updated successfully, but these errors were encountered: