Rollup merge of #99519 - Urgau:check-cfg-implicit, r=petrochenkov

Remove implicit names and values from `--cfg` in `--check-cfg`

This PR remove the implicit names and values from `--cfg` in `--check-cfg` because the behavior is quite surprising but also because it's really easy to inadvertently really on the implicitness and when the `--cfg` is not set anymore to have an unexpected warning from an unexpected condition that pass with the implicitness.

This change in behavior will also enable us to warn when an unexpected `--cfg` is passed, ex: the user wrote `--cfg=unstabl` instead of `--cfg=unstable`. The implementation of the warning will be done in a follow-up PR.

cc `@petrochenkov`
This commit is contained in:
Matthias Krüger 2022-07-31 23:39:38 +02:00 committed by GitHub
commit e820ecdba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 79 deletions

View file

@ -1159,20 +1159,6 @@ impl CrateCheckConfig {
self.fill_well_known_names();
self.fill_well_known_values();
}
/// Fills a `CrateCheckConfig` with configuration names and values that are actually active.
pub fn fill_actual(&mut self, cfg: &CrateConfig) {
for &(k, v) in cfg {
if let Some(names_valid) = &mut self.names_valid {
names_valid.insert(k);
}
if let Some(v) = v {
self.values_valid.entry(k).and_modify(|values| {
values.insert(v);
});
}
}
}
}
pub fn build_configuration(sess: &Session, mut user_cfg: CrateConfig) -> CrateConfig {