Skip to content

Commit

Permalink
Rollup merge of #117522 - Urgau:check-cfg-cli-own-lint, r=petrochenkov
Browse files Browse the repository at this point in the history
Remove `--check-cfg` checking of command line `--cfg` args

Back in rust-lang/rust#100574 we added to the `unexpected_cfgs` lint the checking of `--cfg` CLI arguments and emitted unexpected names and values for them.

The implementation works as expected, but it's usability in particular when using it in combination with Cargo+`RUSTFLAGS` as people who set `RUSTFLAGS=--cfg=tokio_unstable` (or whatever) have `unexpected_cfgs` warnings on all of their crates is debatable. ~~To fix this issue this PR proposes that we split the CLI argument checking into it's own separate allow-by-default lint: `unexpected_cli_cfgs`.~~

~~This has the advantage of letting people who want CLI warnings have them (although not by default anymore), while still linting on every unexpected cfg name and values in the code.~~

After some discussion with the Cargo team ([Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/check-cfg.20and.20RUSTFLAGS.20interaction)) and member of the compiler team (see below), I propose that we follow the suggestion from `@epage:` never check `--cfg` arguments, but still reserve us the possibility to do it later.

We would still lint on unexpected cfgs found in the source code no matter the `--cfg` args passed. This mean reverting rust-lang/rust#100574 but NOT rust-lang/rust#99519.

r? `@petrochenkov`
  • Loading branch information
Noratrieb authored Nov 21, 2023
2 parents f2e9c85 + 7902e0a commit 34aa10e
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 34aa10e

Please sign in to comment.