9

Remove `--check-cfg` checking of command line `--cfg` args by Urgau · Pull Reque...

 9 months ago
source link: https://github.com/rust-lang/rust/pull/117522
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

@Urgau Urgau

commented

Nov 2, 2023

edited

Back in #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) 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 #100574 but NOT #99519.

r? @petrochenkov


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK