Skip to content

Labelled break outside of for loop doesn't work #7299

Closed
@hoelzro

Description

@hoelzro

(using Rust compiled from commit dc4560d)

The following code fails to compile:

fn main() {
    'outer: loop {
        match () {
            () => {
                for std::uint::iterate(0, 8) |_| {
                    loop {
                        break 'outer;
                    }
                }
            },
        }
    }
}

with the following error:

/tmp/test.rs:7:24: 7:37 error: internal compiler error: Break to unknown label   
/tmp/test.rs:7                         break 'outer;
                                             ^~~~~~~~~~~~~

If you comment out the for loop, it compiles fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions