Skip to content

Missing shadowing diagnostic with "@" in pattern-match #27033

Closed
@eefriedman

Description

@eefriedman
fn main() {
  match Some(1) { None @ _ => { } };
  //let None = 1;
}
<anon>:2:19: 2:27 warning: unused variable: `None`, #[warn(unused_variables)] on by default
<anon>:2   match Some(1) { None @ _ => { } };
                           ^~~~~~~~

This is accepted, but probably shouldn't be. (A normal declaration of a variable named None is rejected.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions