Skip to content

Improve wildcard_enum_match_arm lints to take the enums origin into account #7419

Closed
@xFrednet

Description

@xFrednet

The wildcard_enum_match_arm lint disallows the usage of wildcards when using match for enum values. The PR #7407 allows the usage of wildcards if the enum contains values that are unstable or hidden from the documentation.

Such hidden values are usually for internal use. A nice addition to this feature would be to only ignore such hidden enum values if the enums was declared in another crate. Local match statements that use wildcards within the same crate should therefore still be linted by this.

The implementation and hidden enum value check can be found here: clippy_lints/src/matches.rs:1036


@rustbot label +C-enhancement +good-first-issue

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions