-
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 lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The warning about shadowed label names can't be turned off. Seems like it ought to have some name and be under the "future incompatible" lint group.
EDIT (ehuss):
Example:
// Doesn't matter where these are defined, as long as they are in the same function.
'a: loop { break 'a; }
'a: loop { break 'a; } // warning: loop name `'a` shadows a label name that is already in scope
Warning added in #24162, see also #21633 and https://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.