Skip to content

there's no #[allow(shadowed_label_names)] #31745

Closed
@durka

Description

@durka

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

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions