rust-lang / rust-lang/rust-clippy
Add configuration option to make an exception to `wildcard_enum_match_arm` on a per-enum basis
Open
@saberoueslati is already working on this.
Since Sep 17, 2026.
A-ui
C-enhancement
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
The wildcard_enum_match_arm lint is generally pretty helpful for future-proofing my code against adding new variants. However, some enums will never have new variants (e.g. CanId will only ever have the two variants), so future-proofing against new variants being added is a waste of effort and makes the code more complex for no benefit.
It'd be nice if there was a way to configure the lint to exclude certain enums from being linted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.