rust-lang / rust-lang/rust-clippy

Add configuration option to make an exception to `wildcard_enum_match_arm` on a per-enum basis

Open
#17,588 7 comments 2 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.