Skip to content

Commit 9086d34

Browse files
committed
Reduce conflicts for check-cfg target_feature cfg values
1 parent 1c4657d commit 9086d34

File tree

4 files changed

+316
-12
lines changed

4 files changed

+316
-12
lines changed

tests/ui/check-cfg/target_feature.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This test prints all the possible values for the `target_feature` cfg as
2+
// a way to reflect on any changes made in the compiler.
3+
//
4+
// It does not reflect the actual output seen by users which will see a
5+
// truncated list of possible values (at worst).
6+
//
7+
//@ check-pass
8+
//@ no-auto-check-cfg
9+
//@ compile-flags: --check-cfg=cfg()
10+
//@ compile-flags: -Zcheck-cfg-all-expected
11+
//@ normalize-stderr-test: "`, `" -> "`\n`"
12+
13+
fn main() {
14+
cfg!(target_feature = "_UNEXPECTED_VALUE");
15+
//~^ WARNING unexpected `cfg` condition value
16+
}
+297
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
2+
--> $DIR/target_feature.rs:14:10
3+
|
4+
LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: expected values for `target_feature` are: `10e60`
8+
`2e3`
9+
`3e3r1`
10+
`3e3r2`
11+
`3e3r3`
12+
`3e7`
13+
`7e10`
14+
`a`
15+
`aclass`
16+
`adx`
17+
`aes`
18+
`altivec`
19+
`alu32`
20+
`amx-bf16`
21+
`amx-complex`
22+
`amx-fp16`
23+
`amx-int8`
24+
`amx-tile`
25+
`atomics`
26+
`avx`
27+
`avx2`
28+
`avx512bf16`
29+
`avx512bitalg`
30+
`avx512bw`
31+
`avx512cd`
32+
`avx512dq`
33+
`avx512f`
34+
`avx512fp16`
35+
`avx512ifma`
36+
`avx512vbmi`
37+
`avx512vbmi2`
38+
`avx512vl`
39+
`avx512vnni`
40+
`avx512vp2intersect`
41+
`avx512vpopcntdq`
42+
`avxifma`
43+
`avxneconvert`
44+
`avxvnni`
45+
`avxvnniint16`
46+
`avxvnniint8`
47+
`backchain`
48+
`bf16`
49+
`bmi1`
50+
`bmi2`
51+
`bti`
52+
`bulk-memory`
53+
`c`
54+
`cache`
55+
`cmpxchg16b`
56+
`crc`
57+
`crt-static`
58+
`cssc`
59+
`d`
60+
`d32`
61+
`dit`
62+
`doloop`
63+
`dotprod`
64+
`dpb`
65+
`dpb2`
66+
`dsp`
67+
`dsp1e2`
68+
`dspe60`
69+
`e`
70+
`e1`
71+
`e2`
72+
`ecv`
73+
`edsp`
74+
`elrw`
75+
`ermsb`
76+
`exception-handling`
77+
`extended-const`
78+
`f`
79+
`f16c`
80+
`f32mm`
81+
`f64mm`
82+
`faminmax`
83+
`fcma`
84+
`fdivdu`
85+
`fhm`
86+
`flagm`
87+
`flagm2`
88+
`float1e2`
89+
`float1e3`
90+
`float3e4`
91+
`float7e60`
92+
`floate1`
93+
`fma`
94+
`fp-armv8`
95+
`fp16`
96+
`fp64`
97+
`fp8`
98+
`fp8dot2`
99+
`fp8dot4`
100+
`fp8fma`
101+
`fpuv2_df`
102+
`fpuv2_sf`
103+
`fpuv3_df`
104+
`fpuv3_hf`
105+
`fpuv3_hi`
106+
`fpuv3_sf`
107+
`frecipe`
108+
`frintts`
109+
`fxsr`
110+
`gfni`
111+
`hard-float`
112+
`hard-float-abi`
113+
`hard-tp`
114+
`hbc`
115+
`high-registers`
116+
`hvx`
117+
`hvx-length128b`
118+
`hwdiv`
119+
`i8mm`
120+
`jsconv`
121+
`lahfsahf`
122+
`lasx`
123+
`lbt`
124+
`leoncasa`
125+
`lor`
126+
`lse`
127+
`lse128`
128+
`lse2`
129+
`lsx`
130+
`lut`
131+
`lvz`
132+
`lzcnt`
133+
`m`
134+
`mclass`
135+
`mops`
136+
`movbe`
137+
`mp`
138+
`mp1e2`
139+
`msa`
140+
`mte`
141+
`multivalue`
142+
`mutable-globals`
143+
`neon`
144+
`nontrapping-fptoint`
145+
`nvic`
146+
`paca`
147+
`pacg`
148+
`pan`
149+
`partword-atomics`
150+
`pauth-lr`
151+
`pclmulqdq`
152+
`pmuv3`
153+
`popcnt`
154+
`power10-vector`
155+
`power8-altivec`
156+
`power8-vector`
157+
`power9-altivec`
158+
`power9-vector`
159+
`prfchw`
160+
`quadword-atomics`
161+
`rand`
162+
`ras`
163+
`rclass`
164+
`rcpc`
165+
`rcpc2`
166+
`rcpc3`
167+
`rdm`
168+
`rdrand`
169+
`rdseed`
170+
`reference-types`
171+
`relax`
172+
`relaxed-simd`
173+
`reserve-x18`
174+
`rtm`
175+
`sb`
176+
`sha`
177+
`sha2`
178+
`sha3`
179+
`sha512`
180+
`sign-ext`
181+
`simd128`
182+
`sm3`
183+
`sm4`
184+
`sme`
185+
`sme-b16b16`
186+
`sme-f16f16`
187+
`sme-f64f64`
188+
`sme-f8f16`
189+
`sme-f8f32`
190+
`sme-fa64`
191+
`sme-i16i64`
192+
`sme-lutv2`
193+
`sme2`
194+
`sme2p1`
195+
`spe`
196+
`ssbs`
197+
`sse`
198+
`sse2`
199+
`sse3`
200+
`sse4.1`
201+
`sse4.2`
202+
`sse4a`
203+
`ssse3`
204+
`ssve-fp8dot2`
205+
`ssve-fp8dot4`
206+
`ssve-fp8fma`
207+
`sve`
208+
`sve-b16b16`
209+
`sve2`
210+
`sve2-aes`
211+
`sve2-bitperm`
212+
`sve2-sha3`
213+
`sve2-sm4`
214+
`sve2p1`
215+
`tail-call`
216+
`tbm`
217+
`thumb-mode`
218+
`thumb2`
219+
`tme`
220+
`trust`
221+
`trustzone`
222+
`ual`
223+
`unaligned-scalar-mem`
224+
`v`
225+
`v5te`
226+
`v6`
227+
`v6k`
228+
`v6t2`
229+
`v7`
230+
`v8`
231+
`v8.1a`
232+
`v8.2a`
233+
`v8.3a`
234+
`v8.4a`
235+
`v8.5a`
236+
`v8.6a`
237+
`v8.7a`
238+
`v8.8a`
239+
`v8.9a`
240+
`v8plus`
241+
`v9`
242+
`v9.1a`
243+
`v9.2a`
244+
`v9.3a`
245+
`v9.4a`
246+
`v9.5a`
247+
`v9a`
248+
`vaes`
249+
`vdsp2e60f`
250+
`vdspv1`
251+
`vdspv2`
252+
`vector`
253+
`vfp2`
254+
`vfp3`
255+
`vfp4`
256+
`vh`
257+
`virt`
258+
`virtualization`
259+
`vpclmulqdq`
260+
`vsx`
261+
`wfxt`
262+
`wide-arithmetic`
263+
`xop`
264+
`xsave`
265+
`xsavec`
266+
`xsaveopt`
267+
`xsaves`
268+
`zaamo`
269+
`zabha`
270+
`zalrsc`
271+
`zba`
272+
`zbb`
273+
`zbc`
274+
`zbkb`
275+
`zbkc`
276+
`zbkx`
277+
`zbs`
278+
`zdinx`
279+
`zfh`
280+
`zfhmin`
281+
`zfinx`
282+
`zhinx`
283+
`zhinxmin`
284+
`zk`
285+
`zkn`
286+
`zknd`
287+
`zkne`
288+
`zknh`
289+
`zkr`
290+
`zks`
291+
`zksed`
292+
`zksh`, and `zkt`
293+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
294+
= note: `#[warn(unexpected_cfgs)]` on by default
295+
296+
warning: 1 warning emitted
297+

tests/ui/check-cfg/well-known-values.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
//~^ WARN unexpected `cfg` condition value
6161
target_family = "_UNEXPECTED_VALUE",
6262
//~^ WARN unexpected `cfg` condition value
63-
target_feature = "_UNEXPECTED_VALUE",
64-
//~^ WARN unexpected `cfg` condition value
63+
// target_feature = "_UNEXPECTED_VALUE",
64+
// ^ tested in target_feature.rs
6565
target_has_atomic = "_UNEXPECTED_VALUE",
6666
//~^ WARN unexpected `cfg` condition value
6767
target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",

tests/ui/check-cfg/well-known-values.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,6 @@ LL | target_family = "_UNEXPECTED_VALUE",
168168
= note: expected values for `target_family` are: `unix`, `wasm`, and `windows`
169169
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
170170

171-
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
172-
--> $DIR/well-known-values.rs:63:5
173-
|
174-
LL | target_feature = "_UNEXPECTED_VALUE",
175-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176-
|
177-
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `cssc`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `ecv`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `faminmax`, `fcma`, `fdivdu`, `fhm`, `flagm`, `flagm2`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fp8`, `fp8dot2`, `fp8dot4`, `fp8fma`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `hbc`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `leoncasa`, `lor`, `lse`, `lse128`, `lse2`, `lsx`, `lut`, `lvz`, `lzcnt`, `m`, `mclass`, `mops`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `partword-atomics`, `pauth-lr`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `quadword-atomics`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rcpc3`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `reserve-x18`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `sme`, `sme-b16b16`, `sme-f16f16`, `sme-f64f64`, `sme-f8f16`, `sme-f8f32`, `sme-fa64`, `sme-i16i64`, `sme-lutv2`, `sme2`, `sme2p1`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `ssve-fp8dot2`, `ssve-fp8dot4`, `ssve-fp8fma`, `sve`, `sve-b16b16`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `sve2p1`, `tail-call`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `v8.8a`, `v8.9a`, `v8plus`, `v9`, `v9.1a`, `v9.2a`, `v9.3a`, `v9.4a`, `v9.5a`, `v9a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `wfxt`, `wide-arithmetic`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zaamo`, `zabha`, `zalrsc`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt`
178-
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
179-
180171
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
181172
--> $DIR/well-known-values.rs:65:5
182173
|
@@ -297,5 +288,5 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
297288
= note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
298289
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
299290

300-
warning: 30 warnings emitted
291+
warning: 29 warnings emitted
301292

0 commit comments

Comments
 (0)