about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-10-12 16:49:56 +0200
committerUrgau <urgau@numericable.fr>2023-10-12 18:39:04 +0200
commitdcfc484b094f28ed6579ad10dbdc2d18ddf59e4f (patch)
tree9fdb1d0522590a1e55bd7bda2fedd5a9e604ef19
parent72815dc08fd676ec22463055d71855523cf67e44 (diff)
downloadrust-dcfc484b094f28ed6579ad10dbdc2d18ddf59e4f.tar.gz
rust-dcfc484b094f28ed6579ad10dbdc2d18ddf59e4f.zip
check-cfg: mention the unexpected name and value in the primary message
-rw-r--r--compiler/rustc_attr/src/builtin.rs8
-rw-r--r--tests/ui/check-cfg/allow-same-level.stderr2
-rw-r--r--tests/ui/check-cfg/compact-names.stderr2
-rw-r--r--tests/ui/check-cfg/compact-values.stderr2
-rw-r--r--tests/ui/check-cfg/diagnotics.stderr12
-rw-r--r--tests/ui/check-cfg/empty-names.stderr2
-rw-r--r--tests/ui/check-cfg/empty-values.stderr2
-rw-r--r--tests/ui/check-cfg/invalid-cfg-name.stderr2
-rw-r--r--tests/ui/check-cfg/invalid-cfg-value.stderr4
-rw-r--r--tests/ui/check-cfg/mix.stderr52
-rw-r--r--tests/ui/check-cfg/no-values.stderr4
-rw-r--r--tests/ui/check-cfg/order-independant.names_after.stderr4
-rw-r--r--tests/ui/check-cfg/order-independant.names_before.stderr4
-rw-r--r--tests/ui/check-cfg/stmt-no-ice.stderr2
-rw-r--r--tests/ui/check-cfg/values-target-json.stderr2
-rw-r--r--tests/ui/check-cfg/well-known-names.stderr6
-rw-r--r--tests/ui/check-cfg/well-known-values.stderr10
17 files changed, 62 insertions, 58 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs
index f013ff45a4f..76659458dad 100644
--- a/compiler/rustc_attr/src/builtin.rs
+++ b/compiler/rustc_attr/src/builtin.rs
@@ -548,7 +548,11 @@ pub fn cfg_matches(
                     UNEXPECTED_CFGS,
                     cfg.span,
                     lint_node_id,
-                    "unexpected `cfg` condition value",
+                    if let Some(value) = cfg.value {
+                        format!("unexpected `cfg` condition value: `{value}`")
+                    } else {
+                        format!("unexpected `cfg` condition value: (none)")
+                    },
                     BuiltinLintDiagnostics::UnexpectedCfgValue(
                         (cfg.name, cfg.name_span),
                         cfg.value.map(|v| (v, cfg.value_span.unwrap())),
@@ -560,7 +564,7 @@ pub fn cfg_matches(
                     UNEXPECTED_CFGS,
                     cfg.span,
                     lint_node_id,
-                    "unexpected `cfg` condition name",
+                    format!("unexpected `cfg` condition name: `{}`", cfg.name),
                     BuiltinLintDiagnostics::UnexpectedCfgName(
                         (cfg.name, cfg.name_span),
                         cfg.value.map(|v| (v, cfg.value_span.unwrap())),
diff --git a/tests/ui/check-cfg/allow-same-level.stderr b/tests/ui/check-cfg/allow-same-level.stderr
index b46720f62c4..b0c459fabf8 100644
--- a/tests/ui/check-cfg/allow-same-level.stderr
+++ b/tests/ui/check-cfg/allow-same-level.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `FALSE`
   --> $DIR/allow-same-level.rs:7:7
    |
 LL | #[cfg(FALSE)]
diff --git a/tests/ui/check-cfg/compact-names.stderr b/tests/ui/check-cfg/compact-names.stderr
index 4a05c783bff..b0228774b75 100644
--- a/tests/ui/check-cfg/compact-names.stderr
+++ b/tests/ui/check-cfg/compact-names.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `target_architecture`
   --> $DIR/compact-names.rs:11:28
    |
 LL | #[cfg(target(os = "linux", architecture = "arm"))]
diff --git a/tests/ui/check-cfg/compact-values.stderr b/tests/ui/check-cfg/compact-values.stderr
index b7269a652ea..bb2f4915b5e 100644
--- a/tests/ui/check-cfg/compact-values.stderr
+++ b/tests/ui/check-cfg/compact-values.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `X`
   --> $DIR/compact-values.rs:11:28
    |
 LL | #[cfg(target(os = "linux", arch = "X"))]
diff --git a/tests/ui/check-cfg/diagnotics.stderr b/tests/ui/check-cfg/diagnotics.stderr
index 39ceb24ee65..31c0db03a7e 100644
--- a/tests/ui/check-cfg/diagnotics.stderr
+++ b/tests/ui/check-cfg/diagnotics.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `featur`
   --> $DIR/diagnotics.rs:4:7
    |
 LL | #[cfg(featur)]
@@ -7,7 +7,7 @@ LL | #[cfg(featur)]
    = help: expected values for `feature` are: `foo`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `featur`
   --> $DIR/diagnotics.rs:8:7
    |
 LL | #[cfg(featur = "foo")]
@@ -18,7 +18,7 @@ help: there is a config with a similar name and value
 LL | #[cfg(feature = "foo")]
    |       ~~~~~~~
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `featur`
   --> $DIR/diagnotics.rs:12:7
    |
 LL | #[cfg(featur = "fo")]
@@ -30,13 +30,13 @@ help: there is a config with a similar name and different values
 LL | #[cfg(feature = "foo")]
    |       ~~~~~~~~~~~~~~~
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `no_value`
   --> $DIR/diagnotics.rs:19:7
    |
 LL | #[cfg(no_value)]
    |       ^^^^^^^^ help: there is a config with a similar name: `no_values`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `no_value`
   --> $DIR/diagnotics.rs:23:7
    |
 LL | #[cfg(no_value = "foo")]
@@ -47,7 +47,7 @@ help: there is a config with a similar name and no value
 LL | #[cfg(no_values)]
    |       ~~~~~~~~~
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `bar`
   --> $DIR/diagnotics.rs:27:7
    |
 LL | #[cfg(no_values = "bar")]
diff --git a/tests/ui/check-cfg/empty-names.stderr b/tests/ui/check-cfg/empty-names.stderr
index 4443f5dd55b..9bba852c6de 100644
--- a/tests/ui/check-cfg/empty-names.stderr
+++ b/tests/ui/check-cfg/empty-names.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `unknown_key`
   --> $DIR/empty-names.rs:6:7
    |
 LL | #[cfg(unknown_key = "value")]
diff --git a/tests/ui/check-cfg/empty-values.stderr b/tests/ui/check-cfg/empty-values.stderr
index a0168b2caa8..932651c5bfe 100644
--- a/tests/ui/check-cfg/empty-values.stderr
+++ b/tests/ui/check-cfg/empty-values.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `value`
   --> $DIR/empty-values.rs:6:7
    |
 LL | #[cfg(test = "value")]
diff --git a/tests/ui/check-cfg/invalid-cfg-name.stderr b/tests/ui/check-cfg/invalid-cfg-name.stderr
index ed09f8cb66d..8c3c72c9667 100644
--- a/tests/ui/check-cfg/invalid-cfg-name.stderr
+++ b/tests/ui/check-cfg/invalid-cfg-name.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `widnows`
   --> $DIR/invalid-cfg-name.rs:7:7
    |
 LL | #[cfg(widnows)]
diff --git a/tests/ui/check-cfg/invalid-cfg-value.stderr b/tests/ui/check-cfg/invalid-cfg-value.stderr
index 776d264a7ad..947beac6ffd 100644
--- a/tests/ui/check-cfg/invalid-cfg-value.stderr
+++ b/tests/ui/check-cfg/invalid-cfg-value.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `sedre`
   --> $DIR/invalid-cfg-value.rs:7:7
    |
 LL | #[cfg(feature = "sedre")]
@@ -9,7 +9,7 @@ LL | #[cfg(feature = "sedre")]
    = note: expected values for `feature` are: `full`, `serde`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `rand`
   --> $DIR/invalid-cfg-value.rs:14:7
    |
 LL | #[cfg(feature = "rand")]
diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr
index d2dedece20e..b862239bfdc 100644
--- a/tests/ui/check-cfg/mix.stderr
+++ b/tests/ui/check-cfg/mix.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `widnows`
   --> $DIR/mix.rs:11:7
    |
 LL | #[cfg(widnows)]
@@ -6,7 +6,7 @@ LL | #[cfg(widnows)]
    |
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: (none)
   --> $DIR/mix.rs:15:7
    |
 LL | #[cfg(feature)]
@@ -14,7 +14,7 @@ LL | #[cfg(feature)]
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `bar`
   --> $DIR/mix.rs:22:7
    |
 LL | #[cfg(feature = "bar")]
@@ -22,7 +22,7 @@ LL | #[cfg(feature = "bar")]
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:26:7
    |
 LL | #[cfg(feature = "zebra")]
@@ -30,7 +30,7 @@ LL | #[cfg(feature = "zebra")]
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `uu`
   --> $DIR/mix.rs:30:12
    |
 LL | #[cfg_attr(uu, test)]
@@ -46,13 +46,13 @@ 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
+warning: unexpected `cfg` condition name: `widnows`
   --> $DIR/mix.rs:39:10
    |
 LL |     cfg!(widnows);
    |          ^^^^^^^ help: there is a config with a similar name: `windows`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `bar`
   --> $DIR/mix.rs:42:10
    |
 LL |     cfg!(feature = "bar");
@@ -60,7 +60,7 @@ LL |     cfg!(feature = "bar");
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:44:10
    |
 LL |     cfg!(feature = "zebra");
@@ -68,7 +68,7 @@ LL |     cfg!(feature = "zebra");
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:46:10
    |
 LL |     cfg!(xxx = "foo");
@@ -76,7 +76,7 @@ LL |     cfg!(xxx = "foo");
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:48:10
    |
 LL |     cfg!(xxx);
@@ -84,7 +84,7 @@ LL |     cfg!(xxx);
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:50:14
    |
 LL |     cfg!(any(xxx, windows));
@@ -92,7 +92,7 @@ LL |     cfg!(any(xxx, windows));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `bad`
   --> $DIR/mix.rs:52:14
    |
 LL |     cfg!(any(feature = "bad", windows));
@@ -100,7 +100,7 @@ LL |     cfg!(any(feature = "bad", windows));
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:54:23
    |
 LL |     cfg!(any(windows, xxx));
@@ -108,7 +108,7 @@ LL |     cfg!(any(windows, xxx));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:56:20
    |
 LL |     cfg!(all(unix, xxx));
@@ -116,7 +116,7 @@ LL |     cfg!(all(unix, xxx));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `aa`
   --> $DIR/mix.rs:58:14
    |
 LL |     cfg!(all(aa, bb));
@@ -124,7 +124,7 @@ LL |     cfg!(all(aa, bb));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `bb`
   --> $DIR/mix.rs:58:18
    |
 LL |     cfg!(all(aa, bb));
@@ -132,7 +132,7 @@ LL |     cfg!(all(aa, bb));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `aa`
   --> $DIR/mix.rs:61:14
    |
 LL |     cfg!(any(aa, bb));
@@ -140,7 +140,7 @@ LL |     cfg!(any(aa, bb));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `bb`
   --> $DIR/mix.rs:61:18
    |
 LL |     cfg!(any(aa, bb));
@@ -148,7 +148,7 @@ LL |     cfg!(any(aa, bb));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:64:20
    |
 LL |     cfg!(any(unix, feature = "zebra"));
@@ -156,7 +156,7 @@ LL |     cfg!(any(unix, feature = "zebra"));
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:66:14
    |
 LL |     cfg!(any(xxx, feature = "zebra"));
@@ -164,7 +164,7 @@ LL |     cfg!(any(xxx, feature = "zebra"));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:66:19
    |
 LL |     cfg!(any(xxx, feature = "zebra"));
@@ -172,7 +172,7 @@ LL |     cfg!(any(xxx, feature = "zebra"));
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:69:14
    |
 LL |     cfg!(any(xxx, unix, xxx));
@@ -180,7 +180,7 @@ LL |     cfg!(any(xxx, unix, xxx));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `xxx`
   --> $DIR/mix.rs:69:25
    |
 LL |     cfg!(any(xxx, unix, xxx));
@@ -188,7 +188,7 @@ LL |     cfg!(any(xxx, unix, xxx));
    |
    = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:72:14
    |
 LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
@@ -196,7 +196,7 @@ LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:72:33
    |
 LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
@@ -204,7 +204,7 @@ LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
    |
    = note: expected values for `feature` are: `foo`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `zebra`
   --> $DIR/mix.rs:72:52
    |
 LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
diff --git a/tests/ui/check-cfg/no-values.stderr b/tests/ui/check-cfg/no-values.stderr
index ffa87dc58f2..b05a569dd01 100644
--- a/tests/ui/check-cfg/no-values.stderr
+++ b/tests/ui/check-cfg/no-values.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `foo`
   --> $DIR/no-values.rs:6:7
    |
 LL | #[cfg(feature = "foo")]
@@ -9,7 +9,7 @@ LL | #[cfg(feature = "foo")]
    = note: no expected value for `feature`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `foo`
   --> $DIR/no-values.rs:10:7
    |
 LL | #[cfg(test = "foo")]
diff --git a/tests/ui/check-cfg/order-independant.names_after.stderr b/tests/ui/check-cfg/order-independant.names_after.stderr
index 91b81428b38..a308358e485 100644
--- a/tests/ui/check-cfg/order-independant.names_after.stderr
+++ b/tests/ui/check-cfg/order-independant.names_after.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: (none)
   --> $DIR/order-independant.rs:8:7
    |
 LL | #[cfg(a)]
@@ -7,7 +7,7 @@ LL | #[cfg(a)]
    = note: expected values for `a` are: `b`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `unk`
   --> $DIR/order-independant.rs:12:7
    |
 LL | #[cfg(a = "unk")]
diff --git a/tests/ui/check-cfg/order-independant.names_before.stderr b/tests/ui/check-cfg/order-independant.names_before.stderr
index 91b81428b38..a308358e485 100644
--- a/tests/ui/check-cfg/order-independant.names_before.stderr
+++ b/tests/ui/check-cfg/order-independant.names_before.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: (none)
   --> $DIR/order-independant.rs:8:7
    |
 LL | #[cfg(a)]
@@ -7,7 +7,7 @@ LL | #[cfg(a)]
    = note: expected values for `a` are: `b`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `unk`
   --> $DIR/order-independant.rs:12:7
    |
 LL | #[cfg(a = "unk")]
diff --git a/tests/ui/check-cfg/stmt-no-ice.stderr b/tests/ui/check-cfg/stmt-no-ice.stderr
index cf8ff580292..900ea4e4da0 100644
--- a/tests/ui/check-cfg/stmt-no-ice.stderr
+++ b/tests/ui/check-cfg/stmt-no-ice.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `crossbeam_loom`
   --> $DIR/stmt-no-ice.rs:7:11
    |
 LL |     #[cfg(crossbeam_loom)]
diff --git a/tests/ui/check-cfg/values-target-json.stderr b/tests/ui/check-cfg/values-target-json.stderr
index c705152d9fc..e71149f337f 100644
--- a/tests/ui/check-cfg/values-target-json.stderr
+++ b/tests/ui/check-cfg/values-target-json.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `linuz`
   --> $DIR/values-target-json.rs:13:7
    |
 LL | #[cfg(target_os = "linuz")]
diff --git a/tests/ui/check-cfg/well-known-names.stderr b/tests/ui/check-cfg/well-known-names.stderr
index 34c5d6172d9..a5d38a99eee 100644
--- a/tests/ui/check-cfg/well-known-names.stderr
+++ b/tests/ui/check-cfg/well-known-names.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `target_oz`
   --> $DIR/well-known-names.rs:6:7
    |
 LL | #[cfg(target_oz = "linux")]
@@ -8,7 +8,7 @@ LL | #[cfg(target_oz = "linux")]
    |
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `features`
   --> $DIR/well-known-names.rs:13:7
    |
 LL | #[cfg(features = "foo")]
@@ -16,7 +16,7 @@ LL | #[cfg(features = "foo")]
    |       |
    |       help: there is a config with a similar name: `feature`
 
-warning: unexpected `cfg` condition name
+warning: unexpected `cfg` condition name: `uniw`
   --> $DIR/well-known-names.rs:20:7
    |
 LL | #[cfg(uniw)]
diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr
index b381f5a4a0a..6877d8f5bb7 100644
--- a/tests/ui/check-cfg/well-known-values.stderr
+++ b/tests/ui/check-cfg/well-known-values.stderr
@@ -1,4 +1,4 @@
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `linuz`
   --> $DIR/well-known-values.rs:7:7
    |
 LL | #[cfg(target_os = "linuz")]
@@ -9,7 +9,7 @@ LL | #[cfg(target_os = "linuz")]
    = 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`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `0`
   --> $DIR/well-known-values.rs:14:7
    |
 LL | #[cfg(target_has_atomic = "0")]
@@ -19,7 +19,7 @@ LL | #[cfg(target_has_atomic = "0")]
    |
    = note: expected values for `target_has_atomic` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `aa`
   --> $DIR/well-known-values.rs:21:7
    |
 LL | #[cfg(unix = "aa")]
@@ -29,7 +29,7 @@ LL | #[cfg(unix = "aa")]
    |
    = note: no expected value for `unix`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `miri`
   --> $DIR/well-known-values.rs:28:7
    |
 LL | #[cfg(miri = "miri")]
@@ -39,7 +39,7 @@ LL | #[cfg(miri = "miri")]
    |
    = note: no expected value for `miri`
 
-warning: unexpected `cfg` condition value
+warning: unexpected `cfg` condition value: `linux`
   --> $DIR/well-known-values.rs:35:7
    |
 LL | #[cfg(doc = "linux")]