You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #13913 - Urgau:check-cfg-lints-sub-config, r=epage
Add special `check-cfg` lint config for the `unexpected_cfgs` lint
### What does this PR try to resolve?
This PR adds a special `check-cfg` lint config for the `unexpected_cfgs` lint, as it was decided by T-cargo (in today's meeting).
The goal of this lint config is to provide a simple and cost-less alternative to the build-script `cargo::rustc-check-cfg` instruction.
```toml
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(foo, values("bar"))'] }
```
### How should we test and review this PR?
I recommand reviewing commit by commit; and looking at all the new tests added in `check_cfg.rs`, I tried making them as exhaustive as I could, many of them are very similar to their non-config counterpart.
### Additional information
I didn't add *(actually removed from the 1st version of this PR)* the possibility to omit the `level` field if `check-cfg` is specified, #13913 (comment).
Regarding the implementation, I tried making it is as straight forward as possible, nothing over-engineered or complex.
r? `@epage` (or `@weihanglo` maybe)
0 commit comments