-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
The following code:
fn main() {
|| {
'label: loop {
}
};
}
Results in this warning:
main.rs:3:17: 4:10 warning: label name `'label` shadows a label name that is already in scope
main.rs:3 'label: loop {
main.rs:4 }
main.rs:3:17: 4:10 note: shadowed label `'label` declared here
main.rs:3 'label: loop {
main.rs:4 }
Obviously a label can't shadow itself, so there shouldn't be a warning. The issue doesn't occur outside of a closure.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints