`unexpected_cfgs` lint doesn't recognize some standard `cfg`s
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
As part of https://github.com/google/zerocopy/pull/1204, I discovered that the unexpected_cfgs lint fires on some standard cfgs that are common in the ecosystem. The two I discovered so far are:
doc_cfgkani(used by the Kani verifier)
I've had to manually emit directives for these. It's not that onerous, but I could imagine it getting onerous especially for projects that don't already have a build.rs script.
It would be good if the lint could be taught about some of the standard cfgs in the ecosystem to cut down on the noise.
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.
Research direction
Review the linked zerocopy PR #1204, especially the manually emitted directives for doc_cfg and kani, then locate the Rust compiler entry point for the unexpected_cfgs lint. Define which ecosystem cfgs should be recognized and add coverage showing that these uses no longer produce unexpected-cfg warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100