1
Fork 0

Rollup merge of #118908 - Urgau:check-cfg-target-features, r=TaKO8Ki,GuillaumeGomez,workingjubilee

Add all known `target_feature` configs to check-cfg

This PR adds all the known `target_feature` from ~~`rustc_codegen_ssa`~~ `rustc_target` to the well known list of check-cfg.

It does so by moving the list from `rustc_codegen_ssa` to `rustc_target` ~~`rustc_session` (I not sure about this, but some of the moved function take a `Session`)~~, then using it the `fill_well_known` function.

This already proved to be useful since portable-simd had a bad cfg.

cc `@nnethercote` (since we discussed it in https://github.com/rust-lang/rust/pull/118494)
This commit is contained in:
Jubilee 2023-12-14 16:07:47 -08:00 committed by GitHub
commit 576a74b8c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 484 additions and 460 deletions

View file

@ -1486,10 +1486,12 @@ impl CheckCfg {
ins!(sym::sanitizer_cfi_generalize_pointers, no_values);
ins!(sym::sanitizer_cfi_normalize_integers, no_values);
// rustc_codegen_ssa has a list of known target features and their
// stability, but we should allow any target feature as a new target or
// rustc version may introduce new target features.
ins!(sym::target_feature, || ExpectedValues::Any);
ins!(sym::target_feature, empty_values).extend(
rustc_target::target_features::all_known_features()
.map(|(f, _sb)| f)
.chain(rustc_target::target_features::RUSTC_SPECIFIC_FEATURES.iter().cloned())
.map(Symbol::intern),
);
// sym::target_*
{