Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Incorrect warning about label shadowing itself #25343

Closed

Description

@nstoddard

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.

Activity

  1. self-assigned this
    on May 12, 2015
  2. added
    A-diagnostics
    on May 13, 2015
  3. mitchmindtree commented on May 24, 2015

    @mitchmindtree
    Contributor

    I just came across this one myself, just thought I'd +1

  4. added a commit that references this issue on Jul 21, 2015
    39a780d
  5. added 3 commits that reference this issue on May 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnostics

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions