Skip to content

Lint warning for pattern bindings with the same name as a variant #4639

Closed
@nikomatsakis

Description

@nikomatsakis

Related to #4612 and #3070, it would be good to have a lint rule like: If there is ever a variable binding "foo" whose type is an enum E that includes a variant named "foo", report a warning. This should probably be done in the exhaustiveness or type checker so that the warning is reported early in compilation.

I'm tossing on the 1.0 list as another of those "very nice to have when you are dotting your i's and crossing your t's" sort of things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions