Skip to content

ICE on loop {|_: [_; continue]| {}} #51761

Closed
@est31

Description

@est31

The following code ICEs on nightly, stable and beta:

fn main() {
    loop {|_: [_; continue]| {}}
}

The ICE message is:

error: internal compiler error: librustc_mir/hair/cx/expr.rs:551: invalid loop id for continue: not inside loop scope

As of filing this bug, PR #51731 does not fix it. If I apply it, I'm getting:

error: internal compiler error: librustc_mir/build/scope.rs:552: no enclosing breakable scope found
  --> $DIR/issue-XXXX.rs:12:19
   |
LL |     loop {|_: [_; continue]| {}}
   |                   ^^^^^^^^

Metadata

Metadata

Assignees

Labels

I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions