Request: lint on `#[non_exhaustive]` that do nothing
Open
@mu001999 is already working on this.
Since Jul 28, 2026.
A-attributes
A-lints
C-feature-request
needs-triage
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
#[non_exhaustive]applied to a struct/enum/variant that isn'tpubdoes nothing.#[non_exhaustive]applied to a struct with private fields does nothing.
These two cases should be warned by the compiler.
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.