Closed
Description
Given the following code:
#![allow(non_camel_case_types, unused_variables, dead_code)]
enum Foo {
c
}
fn foo(c: Foo) {}
The current output is:
warning[E0170]: pattern binding `c` is named the same as one of the variants of the type `Foo`
--> src/lib.rs:7:8
|
7 | fn foo(c: Foo) {}
| ^ help: to match on the variant, qualify the path: `Foo::c`
|
= note: `#[warn(bindings_with_variant_name)]` on by default
Ideally the lint should not trigger on such a pattern, it does not really make sense and the suggestion is wrong altogether,
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: Confusing error or lint that should be reworked.Diagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A structured suggestion resulting in incorrect code.Relevant to the compiler team, which will review and decide on the PR/issue.