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

error: internal compiler error: librustc/middle/liveness.rs:1081: loop scope error: unlabeled control flow (break or continue) in while condition #50802

Closed
vegard opened this issue May 16, 2018 · 4 comments

Comments

@vegard
Copy link

vegard commented May 16, 2018

Input:

#[allow(unreachable_code)]
fn main() {
    loop {
        break while continue {
        }
    }
}

Output:

$ rustc -
error: internal compiler error: librustc/middle/liveness.rs:1081: loop scope error: unlabeled control flow (break or continue) in while condition
 --> <anon>:4:21
  |
4 |         break while continue {
  |                     ^^^^^^^^

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:499:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.27.0-dev running on x86_64-unknown-linux-gnu

This is on commit eca0da5.

@est31
Copy link
Member

est31 commented May 16, 2018

I've edited that code just recently so would want to work on this

@est31
Copy link
Member

est31 commented May 17, 2018

Made PR #50829 to fix this

@vegard
Copy link
Author

vegard commented May 17, 2018

@est31 Thanks for fixing this :-) I also reported a couple of other looping-related bugs in #50576 in case you also want to have a look at those.

@est31
Copy link
Member

est31 commented May 17, 2018

@vegard wow those are quite nice bugs :p. Will have a look.

kennytm added a commit to kennytm/rust that referenced this issue May 19, 2018
CheckLoopVisitor: also visit break expressions

Fixes rust-lang#50802
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants