Skip to content
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 "break to unknown label" when while has a labeled break of itself in condition #37353

Closed
leoyvens opened this issue Oct 22, 2016 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@leoyvens
Copy link
Contributor

fn main() {
    loop { 'w: while break 'w { } }
}

ICEs with:

rustc 1.14.0-nightly (6e8f92f11 2016-10-07)
error: internal compiler error: ../src/librustc/middle/liveness.rs:1057: break to unknown label
 --> <anon>:3:19
  |
3 |         'w: while break 'w { }
  |                   ^^^^^^^^

Code like this was found in issue #21751.

@jonas-schievink
Copy link
Contributor

This complains about break outside of loop:

fn main() {
    while break {}
}

While this loops forever:

fn main() {
    loop { while break {} }
}

This means that the break doesn't actually break out of the outer loop, as the first error might suggest.

@TimNN TimNN added 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. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Oct 22, 2016
@TimNN
Copy link
Contributor

TimNN commented Oct 22, 2016

Regression from 1.11.0 to 1.12.0.

On nightly, this was introduced between nightly-2016-07-15 and nightly-2016-07-16 (Changes).

Introduced in #34570, cc @jseyfried.

@jseyfried
Copy link
Contributor

Fixed in #37360.

bors added a commit that referenced this issue Oct 25, 2016
resolve: fix label scopes

Fixes #37353 (turns an ICE back into an error).
r? @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants