Skip to content

Commit 5a17ee7

Browse files
committed
Avoid target_os and target_arch in some check-cfg tests
as they unnecessarily clutter the diagnostic output and make the experience of adding a new target to the compiler more painful than it should be. target_os and target_arch are still being tested in the well-known-values.rs test, but in one place.
1 parent a002814 commit 5a17ee7

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

tests/ui/check-cfg/compact-values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#[cfg(target(os = "linux", arch = "arm"))]
99
pub fn expected() {}
1010

11-
#[cfg(target(os = "linux", arch = "X"))]
11+
#[cfg(target(os = "linux", pointer_width = "X"))]
1212
//~^ WARNING unexpected `cfg` condition value
1313
pub fn unexpected() {}
1414

tests/ui/check-cfg/compact-values.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: unexpected `cfg` condition value: `X`
22
--> $DIR/compact-values.rs:11:28
33
|
4-
LL | #[cfg(target(os = "linux", arch = "X"))]
5-
| ^^^^^^^^^^
4+
LL | #[cfg(target(os = "linux", pointer_width = "X"))]
5+
| ^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `csky`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips32r6`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`
7+
= note: expected values for `target_pointer_width` are: `16`, `32`, `64`
88
= note: `#[warn(unexpected_cfgs)]` on by default
99

1010
warning: 1 warning emitted

tests/ui/check-cfg/values-target-json.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#[lang = "sized"]
1111
trait Sized {}
1212

13-
#[cfg(target_os = "linuz")]
14-
//~^ WARNING unexpected `cfg` condition value
15-
fn target_os_linux_misspell() {}
16-
1713
#[cfg(target_os = "linux")]
1814
fn target_os_linux() {}
1915

tests/ui/check-cfg/values-target-json.stderr

-13
This file was deleted.

0 commit comments

Comments
 (0)