Mark existing well-known cfg as unknown
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
There is no way to mark existing well-known attributes as unknown, is there? Specifically, I think it would be nice if there was a way for rustc to raise a warning when it encounters
cfg(test)(which cargo could then make use of for crates that uselib.test = false).
Originally posted by @jplatte in https://github.com/rust-lang/rust/issues/82450#issuecomment-1802229763
@rustbot label +C-discussion +F-check-cfg -needs-triage
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
Start by reviewing rustc's existing check-cfg handling for well-known attributes, focusing on cfg(test), and then examine how Cargo's lib.test = false setting could consume a warning. The work is complete when existing well-known cfg attributes can be marked unknown and rustc warns for cfg(test) in the relevant configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100