summaryrefslogtreecommitdiffstats
path: root/src/test/ui/check-cfg
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/check-cfg/allow-at-crate-level.rs8
-rw-r--r--src/test/ui/check-cfg/compact-values.stderr2
-rw-r--r--src/test/ui/check-cfg/empty-values.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-cfg-value.stderr8
-rw-r--r--src/test/ui/check-cfg/mix.rs2
-rw-r--r--src/test/ui/check-cfg/mix.stderr10
-rw-r--r--src/test/ui/check-cfg/no-values.stderr2
-rw-r--r--src/test/ui/check-cfg/well-known-values.stderr2
10 files changed, 30 insertions, 10 deletions
diff --git a/src/test/ui/check-cfg/allow-at-crate-level.rs b/src/test/ui/check-cfg/allow-at-crate-level.rs
new file mode 100644
index 000000000..ce3383a29
--- /dev/null
+++ b/src/test/ui/check-cfg/allow-at-crate-level.rs
@@ -0,0 +1,8 @@
+// This test check that #![allow(unexpected_cfgs)] works with --cfg
+//
+// check-pass
+// compile-flags: --cfg=unexpected --check-cfg=names() -Z unstable-options
+
+#![allow(unexpected_cfgs)]
+
+fn main() {}
diff --git a/src/test/ui/check-cfg/compact-values.stderr b/src/test/ui/check-cfg/compact-values.stderr
index a196e1537..9864aa385 100644
--- a/src/test/ui/check-cfg/compact-values.stderr
+++ b/src/test/ui/check-cfg/compact-values.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(target(os = "linux", arch = "X"))]
| ^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `target_arch` are: aarch64, arm, avr, bpf, hexagon, m68k, mips, mips64, msp430, nvptx64, powerpc, powerpc64, riscv32, riscv64, s390x, sparc, sparc64, wasm32, wasm64, x86, x86_64
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/check-cfg/empty-values.stderr b/src/test/ui/check-cfg/empty-values.stderr
index 10dab5034..a0168b2ca 100644
--- a/src/test/ui/check-cfg/empty-values.stderr
+++ b/src/test/ui/check-cfg/empty-values.stderr
@@ -6,8 +6,8 @@ LL | #[cfg(test = "value")]
| |
| help: remove the value
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: no expected value for `test`
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
index bdfbc3d54..8fadcc1f9 100644
--- a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
+++ b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
@@ -1,2 +1,2 @@
-error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifers)
+error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifiers)
diff --git a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
index b25882baa..061d3f0e9 100644
--- a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
+++ b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
@@ -1,2 +1,2 @@
-error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifer)
+error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifier)
diff --git a/src/test/ui/check-cfg/invalid-cfg-value.stderr b/src/test/ui/check-cfg/invalid-cfg-value.stderr
index 6cce31d33..60abcb188 100644
--- a/src/test/ui/check-cfg/invalid-cfg-value.stderr
+++ b/src/test/ui/check-cfg/invalid-cfg-value.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(feature = "sedre")]
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `feature` are: full, serde
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/invalid-cfg-value.rs:14:7
@@ -15,5 +15,9 @@ LL | #[cfg(feature = "rand")]
|
= note: expected values for `feature` are: full, serde
-warning: 2 warnings emitted
+warning: unexpected condition value `rand` for condition name `feature`
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
+
+warning: 3 warnings emitted
diff --git a/src/test/ui/check-cfg/mix.rs b/src/test/ui/check-cfg/mix.rs
index 8e3d20d50..4e488fc03 100644
--- a/src/test/ui/check-cfg/mix.rs
+++ b/src/test/ui/check-cfg/mix.rs
@@ -3,7 +3,7 @@
// we correctly lint on the `cfg!` macro and `cfg_attr` attribute.
//
// check-pass
-// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" -Z unstable-options
+// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" --cfg unknown_name -Z unstable-options
#[cfg(windows)]
fn do_windows_stuff() {}
diff --git a/src/test/ui/check-cfg/mix.stderr b/src/test/ui/check-cfg/mix.stderr
index e51b75b3d..9cf887ec7 100644
--- a/src/test/ui/check-cfg/mix.stderr
+++ b/src/test/ui/check-cfg/mix.stderr
@@ -28,6 +28,14 @@ warning: unexpected `cfg` condition name
LL | #[cfg_attr(uu, test)]
| ^^
+warning: unexpected condition value `bar` for condition name `feature`
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
+
+warning: unexpected `unknown_name` as condition name
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
+
warning: unexpected `cfg` condition name
--> $DIR/mix.rs:35:10
|
@@ -170,5 +178,5 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
|
= note: expected values for `feature` are: foo
-warning: 25 warnings emitted
+warning: 27 warnings emitted
diff --git a/src/test/ui/check-cfg/no-values.stderr b/src/test/ui/check-cfg/no-values.stderr
index 7025b4cd7..8c926d187 100644
--- a/src/test/ui/check-cfg/no-values.stderr
+++ b/src/test/ui/check-cfg/no-values.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(feature = "foo")]
| ^^^^^^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: no expected value for `feature`
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/no-values.rs:10:7
diff --git a/src/test/ui/check-cfg/well-known-values.stderr b/src/test/ui/check-cfg/well-known-values.stderr
index 24ce2280c..4ec74494f 100644
--- a/src/test/ui/check-cfg/well-known-values.stderr
+++ b/src/test/ui/check-cfg/well-known-values.stderr
@@ -6,8 +6,8 @@ LL | #[cfg(target_os = "linuz")]
| |
| help: did you mean: `"linux"`
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `target_os` are: android, cuda, dragonfly, emscripten, espidf, freebsd, fuchsia, haiku, hermit, horizon, illumos, ios, l4re, linux, macos, netbsd, none, openbsd, psp, redox, solaris, solid_asp3, tvos, uefi, unknown, vxworks, wasi, watchos, windows, xous
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/well-known-values.rs:14:7