Use all the known features in check-cfg

This commit is contained in:
Urgau 2023-12-12 22:04:48 +01:00
parent 428395e064
commit acac133997
3 changed files with 26 additions and 17 deletions

View File

@ -1485,10 +1485,8 @@ macro_rules! ins {
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)| Symbol::intern(f)));
// sym::target_*
{

View File

@ -51,7 +51,8 @@
//~^ WARN unexpected `cfg` condition value
target_family = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value
target_feature = "_UNEXPECTED_VALUE", // currently *any* values are "expected"
target_feature = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value
target_has_atomic = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value
target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",

View File

@ -152,7 +152,17 @@ LL | target_family = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:55:5
--> $DIR/well-known-values.rs:54:5
|
LL | target_feature = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512er`, `avx512f`, `avx512ifma`, `avx512pf`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `f`, `f16c`, `f32mm`, `f64mm`, `fast-unaligned-access`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sign-ext`, `simd128`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`
= help: to expect this configuration use `--check-cfg=cfg(target_feature, values("_UNEXPECTED_VALUE"))`
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:56:5
|
LL | target_has_atomic = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -162,7 +172,7 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:57:5
--> $DIR/well-known-values.rs:58:5
|
LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -172,7 +182,7 @@ LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:59:5
--> $DIR/well-known-values.rs:60:5
|
LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -182,7 +192,7 @@ LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:61:5
--> $DIR/well-known-values.rs:62:5
|
LL | target_os = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -192,7 +202,7 @@ LL | target_os = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:63:5
--> $DIR/well-known-values.rs:64:5
|
LL | target_pointer_width = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -202,7 +212,7 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:65:5
--> $DIR/well-known-values.rs:66:5
|
LL | target_thread_local = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^----------------------
@ -214,7 +224,7 @@ LL | target_thread_local = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:67:5
--> $DIR/well-known-values.rs:68:5
|
LL | target_vendor = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -224,7 +234,7 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:69:5
--> $DIR/well-known-values.rs:70:5
|
LL | test = "_UNEXPECTED_VALUE",
| ^^^^----------------------
@ -236,7 +246,7 @@ LL | test = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:71:5
--> $DIR/well-known-values.rs:72:5
|
LL | unix = "_UNEXPECTED_VALUE",
| ^^^^----------------------
@ -248,7 +258,7 @@ LL | unix = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:73:5
--> $DIR/well-known-values.rs:74:5
|
LL | windows = "_UNEXPECTED_VALUE",
| ^^^^^^^----------------------
@ -260,7 +270,7 @@ LL | windows = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `linuz`
--> $DIR/well-known-values.rs:79:7
--> $DIR/well-known-values.rs:80:7
|
LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
| ^^^^^^^^^^^^-------
@ -271,5 +281,5 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
= help: to expect this configuration use `--check-cfg=cfg(target_os, values("linuz"))`
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
warning: 25 warnings emitted
warning: 26 warnings emitted