Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a90372c

Browse files
committedDec 13, 2023
Auto merge of #118213 - Urgau:check-cfg-diagnostics-rustc-cargo, r=petrochenkov
Add more suggestions to unexpected cfg names and values This pull request adds more suggestion to unexpected cfg names and values diagnostics: - it first adds a links to the [rustc unstable book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html) or the [Cargo reference](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg), depending if rustc is invoked by Cargo - it secondly adds a suggestion on how to expect the cfg name or value: *excluding well known names and values* - for Cargo: it suggest using a feature or `cargo:rust-check-cfg` in build script - for rustc: it suggest using `--check-cfg` (with the correct invocation) Those diagnostics improvements are directed towards enabling users to fix the issue if the previous suggestions weren't good enough. r? `@petrochenkov`
2 parents 2862500 + f6617d0 commit a90372c

36 files changed

+468
-326
lines changed
 

‎compiler/rustc_lint/src/context.rs

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,13 @@ pub trait LintContext {
706706
},
707707
BuiltinLintDiagnostics::UnexpectedCfgName((name, name_span), value) => {
708708
let possibilities: Vec<Symbol> = sess.parse_sess.check_config.expecteds.keys().copied().collect();
709+
let is_from_cargo = std::env::var_os("CARGO").is_some();
710+
let mut is_feature_cfg = name == sym::feature;
709711

712+
if is_feature_cfg && is_from_cargo {
713+
db.help("consider defining some features in `Cargo.toml`");
710714
// Suggest the most probable if we found one
711-
if let Some(best_match) = find_best_match_for_name(&possibilities, name, None) {
715+
} else if let Some(best_match) = find_best_match_for_name(&possibilities, name, None) {
712716
if let Some(ExpectedValues::Some(best_match_values)) =
713717
sess.parse_sess.check_config.expecteds.get(&best_match) {
714718
let mut possibilities = best_match_values.iter()
@@ -741,8 +745,8 @@ pub trait LintContext {
741745
} else {
742746
db.span_suggestion(name_span, "there is a config with a similar name", best_match, Applicability::MaybeIncorrect);
743747
}
744-
} else if name == sym::feature && std::env::var_os("CARGO").is_some() {
745-
db.help("consider defining some features in `Cargo.toml`");
748+
749+
is_feature_cfg |= best_match == sym::feature;
746750
} else if !possibilities.is_empty() {
747751
let mut possibilities = possibilities.iter()
748752
.map(Symbol::as_str)
@@ -756,6 +760,23 @@ pub trait LintContext {
756760
// once.
757761
db.help_once(format!("expected names are: `{possibilities}`"));
758762
}
763+
764+
let inst = if let Some((value, _value_span)) = value {
765+
let pre = if is_from_cargo { "\\" } else { "" };
766+
format!("cfg({name}, values({pre}\"{value}{pre}\"))")
767+
} else {
768+
format!("cfg({name})")
769+
};
770+
771+
if is_from_cargo {
772+
if !is_feature_cfg {
773+
db.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
774+
}
775+
db.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
776+
} else {
777+
db.help(format!("to expect this configuration use `--check-cfg={inst}`"));
778+
db.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
779+
}
759780
},
760781
BuiltinLintDiagnostics::UnexpectedCfgValue((name, name_span), value) => {
761782
let Some(ExpectedValues::Some(values)) = &sess.parse_sess.check_config.expecteds.get(&name) else {
@@ -767,6 +788,7 @@ pub trait LintContext {
767788
.copied()
768789
.flatten()
769790
.collect();
791+
let is_from_cargo = std::env::var_os("CARGO").is_some();
770792

771793
// Show the full list if all possible values for a given name, but don't do it
772794
// for names as the possibilities could be very long
@@ -787,6 +809,8 @@ pub trait LintContext {
787809
db.span_suggestion(value_span, "there is a expected value with a similar name", format!("\"{best_match}\""), Applicability::MaybeIncorrect);
788810

789811
}
812+
} else if name == sym::feature && is_from_cargo {
813+
db.help(format!("consider defining `{name}` as feature in `Cargo.toml`"));
790814
} else if let &[first_possibility] = &possibilities[..] {
791815
db.span_suggestion(name_span.shrink_to_hi(), "specify a config value", format!(" = \"{first_possibility}\""), Applicability::MaybeIncorrect);
792816
}
@@ -796,6 +820,27 @@ pub trait LintContext {
796820
db.span_suggestion(name_span.shrink_to_hi().to(value_span), "remove the value", "", Applicability::MaybeIncorrect);
797821
}
798822
}
823+
824+
let inst = if let Some((value, _value_span)) = value {
825+
let pre = if is_from_cargo { "\\" } else { "" };
826+
format!("cfg({name}, values({pre}\"{value}{pre}\"))")
827+
} else {
828+
format!("cfg({name})")
829+
};
830+
831+
if is_from_cargo {
832+
if name == sym::feature {
833+
if let Some((value, _value_span)) = value {
834+
db.help(format!("consider adding `{value}` as a feature in `Cargo.toml`"));
835+
}
836+
} else {
837+
db.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
838+
}
839+
db.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
840+
} else {
841+
db.help(format!("to expect this configuration use `--check-cfg={inst}`"));
842+
db.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
843+
}
799844
},
800845
BuiltinLintDiagnostics::DeprecatedWhereclauseLocation(new_span, suggestion) => {
801846
db.multipart_suggestion(

‎tests/rustdoc-ui/check-cfg/check-cfg.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ warning: unexpected `cfg` condition name: `uniz`
44
LL | #[cfg(uniz)]
55
| ^^^^ help: there is a config with a similar name: `unix`
66
|
7+
= help: to expect this configuration use `--check-cfg=cfg(uniz)`
8+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
79
= note: `#[warn(unexpected_cfgs)]` on by default
810

911
warning: 1 warning emitted

‎tests/rustdoc-ui/doctest/check-cfg-test.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(feature = "invalid")]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
77
= note: expected values for `feature` are: `test`
8+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("invalid"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/allow-same-level.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(FALSE)]
55
| ^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(FALSE)`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
warning: unexpected `cfg` condition name: `feature`
2+
--> $DIR/cargo-feature.rs:13:7
3+
|
4+
LL | #[cfg(feature = "serde")]
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= help: consider defining some features in `Cargo.toml`
8+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
9+
= note: `#[warn(unexpected_cfgs)]` on by default
10+
11+
warning: unexpected `cfg` condition name: `tokio_unstable`
12+
--> $DIR/cargo-feature.rs:18:7
13+
|
14+
LL | #[cfg(tokio_unstable)]
15+
| ^^^^^^^^^^^^^^
16+
|
17+
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
18+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs`
19+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
20+
21+
warning: unexpected `cfg` condition name: `CONFIG_NVME`
22+
--> $DIR/cargo-feature.rs:22:7
23+
|
24+
LL | #[cfg(CONFIG_NVME = "m")]
25+
| ^^^^^^^^^^^^^^^^^
26+
|
27+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of a `build.rs`
28+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
29+
30+
warning: 3 warnings emitted
31+

‎tests/ui/check-cfg/cargo-feature.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@
33
// list of all the expected names
44
//
55
// check-pass
6+
// revisions: some none
67
// rustc-env:CARGO=/usr/bin/cargo
78
// compile-flags: --check-cfg=cfg() -Z unstable-options
8-
// error-pattern:Cargo.toml
9+
// [some]compile-flags: --check-cfg=cfg(feature,values("bitcode"))
10+
// [some]compile-flags: --check-cfg=cfg(CONFIG_NVME,values("y"))
11+
// [none]error-pattern:Cargo.toml
912

1013
#[cfg(feature = "serde")]
11-
//~^ WARNING unexpected `cfg` condition name
14+
//[none]~^ WARNING unexpected `cfg` condition name
15+
//[some]~^^ WARNING unexpected `cfg` condition value
1216
fn ser() {}
1317

18+
#[cfg(tokio_unstable)]
19+
//~^ WARNING unexpected `cfg` condition name
20+
fn tokio() {}
21+
22+
#[cfg(CONFIG_NVME = "m")]
23+
//[none]~^ WARNING unexpected `cfg` condition name
24+
//[some]~^^ WARNING unexpected `cfg` condition value
25+
fn tokio() {}
26+
1427
fn main() {}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
warning: unexpected `cfg` condition value: `serde`
2+
--> $DIR/cargo-feature.rs:13:7
3+
|
4+
LL | #[cfg(feature = "serde")]
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: expected values for `feature` are: `bitcode`
8+
= help: consider adding `serde` as a feature in `Cargo.toml`
9+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: unexpected `cfg` condition name: `tokio_unstable`
13+
--> $DIR/cargo-feature.rs:18:7
14+
|
15+
LL | #[cfg(tokio_unstable)]
16+
| ^^^^^^^^^^^^^^
17+
|
18+
= help: expected names are: `CONFIG_NVME`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
19+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs`
20+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
21+
22+
warning: unexpected `cfg` condition value: `m`
23+
--> $DIR/cargo-feature.rs:22:7
24+
|
25+
LL | #[cfg(CONFIG_NVME = "m")]
26+
| ^^^^^^^^^^^^^^---
27+
| |
28+
| help: there is a expected value with a similar name: `"y"`
29+
|
30+
= note: expected values for `CONFIG_NVME` are: `y`
31+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of a `build.rs`
32+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
33+
34+
warning: 3 warnings emitted
35+

‎tests/ui/check-cfg/cargo-feature.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎tests/ui/check-cfg/compact-names.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(target(os = "linux", architecture = "arm"))]
55
| ^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(target(os = "linux", pointer_width = "X"))]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
77
= note: expected values for `target_pointer_width` are: `16`, `32`, `64`
8+
= help: to expect this configuration use `--check-cfg=cfg(target_pointer_width, values("X"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/concat-values.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(my_cfg)]
55
| ^^^^^^
66
|
77
= note: expected values for `my_cfg` are: `bar`, `foo`
8+
= help: to expect this configuration use `--check-cfg=cfg(my_cfg)`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: unexpected `cfg` condition value: `unk`
@@ -14,6 +16,8 @@ LL | #[cfg(my_cfg = "unk")]
1416
| ^^^^^^^^^^^^^^
1517
|
1618
= note: expected values for `my_cfg` are: `bar`, `foo`
19+
= help: to expect this configuration use `--check-cfg=cfg(my_cfg, values("unk"))`
20+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1721

1822
warning: 2 warnings emitted
1923

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
warning: unexpected `cfg` condition name: `featur`
2+
--> $DIR/diagnotics.rs:7:7
3+
|
4+
LL | #[cfg(featur)]
5+
| ^^^^^^ help: there is a config with a similar name: `feature`
6+
|
7+
= help: expected values for `feature` are: `foo`
8+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
9+
= note: `#[warn(unexpected_cfgs)]` on by default
10+
11+
warning: unexpected `cfg` condition name: `featur`
12+
--> $DIR/diagnotics.rs:11:7
13+
|
14+
LL | #[cfg(featur = "foo")]
15+
| ^^^^^^^^^^^^^^
16+
|
17+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
18+
help: there is a config with a similar name and value
19+
|
20+
LL | #[cfg(feature = "foo")]
21+
| ~~~~~~~
22+
23+
warning: unexpected `cfg` condition name: `featur`
24+
--> $DIR/diagnotics.rs:15:7
25+
|
26+
LL | #[cfg(featur = "fo")]
27+
| ^^^^^^^^^^^^^
28+
|
29+
= help: expected values for `feature` are: `foo`
30+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
31+
help: there is a config with a similar name and different values
32+
|
33+
LL | #[cfg(feature = "foo")]
34+
| ~~~~~~~~~~~~~~~
35+
36+
warning: unexpected `cfg` condition name: `no_value`
37+
--> $DIR/diagnotics.rs:22:7
38+
|
39+
LL | #[cfg(no_value)]
40+
| ^^^^^^^^ help: there is a config with a similar name: `no_values`
41+
|
42+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_value)");` to the top of a `build.rs`
43+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
44+
45+
warning: unexpected `cfg` condition name: `no_value`
46+
--> $DIR/diagnotics.rs:26:7
47+
|
48+
LL | #[cfg(no_value = "foo")]
49+
| ^^^^^^^^^^^^^^^^
50+
|
51+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of a `build.rs`
52+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
53+
help: there is a config with a similar name and no value
54+
|
55+
LL | #[cfg(no_values)]
56+
| ~~~~~~~~~
57+
58+
warning: unexpected `cfg` condition value: `bar`
59+
--> $DIR/diagnotics.rs:30:7
60+
|
61+
LL | #[cfg(no_values = "bar")]
62+
| ^^^^^^^^^--------
63+
| |
64+
| help: remove the value
65+
|
66+
= note: no expected value for `no_values`
67+
= help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of a `build.rs`
68+
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
69+
70+
warning: 6 warnings emitted
71+

‎tests/ui/check-cfg/diagnotics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// check-pass
2+
// revisions: cargo rustc
3+
// [rustc]unset-rustc-env:CARGO
4+
// [cargo]rustc-env:CARGO=/usr/bin/cargo
25
// compile-flags: --check-cfg=cfg(feature,values("foo")) --check-cfg=cfg(no_values) -Z unstable-options
36

47
#[cfg(featur)]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
warning: unexpected `cfg` condition name: `featur`
2+
--> $DIR/diagnotics.rs:7:7
3+
|
4+
LL | #[cfg(featur)]
5+
| ^^^^^^ help: there is a config with a similar name: `feature`
6+
|
7+
= help: expected values for `feature` are: `foo`
8+
= help: to expect this configuration use `--check-cfg=cfg(featur)`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: unexpected `cfg` condition name: `featur`
13+
--> $DIR/diagnotics.rs:11:7
14+
|
15+
LL | #[cfg(featur = "foo")]
16+
| ^^^^^^^^^^^^^^
17+
|
18+
= help: to expect this configuration use `--check-cfg=cfg(featur, values("foo"))`
19+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
20+
help: there is a config with a similar name and value
21+
|
22+
LL | #[cfg(feature = "foo")]
23+
| ~~~~~~~
24+
25+
warning: unexpected `cfg` condition name: `featur`
26+
--> $DIR/diagnotics.rs:15:7
27+
|
28+
LL | #[cfg(featur = "fo")]
29+
| ^^^^^^^^^^^^^
30+
|
31+
= help: expected values for `feature` are: `foo`
32+
= help: to expect this configuration use `--check-cfg=cfg(featur, values("fo"))`
33+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
34+
help: there is a config with a similar name and different values
35+
|
36+
LL | #[cfg(feature = "foo")]
37+
| ~~~~~~~~~~~~~~~
38+
39+
warning: unexpected `cfg` condition name: `no_value`
40+
--> $DIR/diagnotics.rs:22:7
41+
|
42+
LL | #[cfg(no_value)]
43+
| ^^^^^^^^ help: there is a config with a similar name: `no_values`
44+
|
45+
= help: to expect this configuration use `--check-cfg=cfg(no_value)`
46+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
47+
48+
warning: unexpected `cfg` condition name: `no_value`
49+
--> $DIR/diagnotics.rs:26:7
50+
|
51+
LL | #[cfg(no_value = "foo")]
52+
| ^^^^^^^^^^^^^^^^
53+
|
54+
= help: to expect this configuration use `--check-cfg=cfg(no_value, values("foo"))`
55+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
56+
help: there is a config with a similar name and no value
57+
|
58+
LL | #[cfg(no_values)]
59+
| ~~~~~~~~~
60+
61+
warning: unexpected `cfg` condition value: `bar`
62+
--> $DIR/diagnotics.rs:30:7
63+
|
64+
LL | #[cfg(no_values = "bar")]
65+
| ^^^^^^^^^--------
66+
| |
67+
| help: remove the value
68+
|
69+
= note: no expected value for `no_values`
70+
= help: to expect this configuration use `--check-cfg=cfg(no_values, values("bar"))`
71+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
72+
73+
warning: 6 warnings emitted
74+

‎tests/ui/check-cfg/diagnotics.stderr

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: unexpected `cfg` condition value: `value`
@@ -16,18 +18,26 @@ LL | #[cfg(test = "value")]
1618
| help: remove the value
1719
|
1820
= note: no expected value for `test`
21+
= help: to expect this configuration use `--check-cfg=cfg(test, values("value"))`
22+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1923

2024
warning: unexpected `cfg` condition name: `feature`
2125
--> $DIR/exhaustive-names-values.rs:18:7
2226
|
2327
LL | #[cfg(feature = "unk")]
2428
| ^^^^^^^^^^^^^^^
29+
|
30+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))`
31+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2532

2633
warning: unexpected `cfg` condition name: `feature`
2734
--> $DIR/exhaustive-names-values.rs:25:7
2835
|
2936
LL | #[cfg(feature = "std")]
3037
| ^^^^^^^^^^^^^^^
38+
|
39+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("std"))`
40+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
3141

3242
warning: 4 warnings emitted
3343

‎tests/ui/check-cfg/exhaustive-names-values.empty_names_values.stderr

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎tests/ui/check-cfg/exhaustive-names-values.feature.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: unexpected `cfg` condition value: `value`
@@ -16,6 +18,8 @@ LL | #[cfg(test = "value")]
1618
| help: remove the value
1719
|
1820
= note: no expected value for `test`
21+
= help: to expect this configuration use `--check-cfg=cfg(test, values("value"))`
22+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1923

2024
warning: unexpected `cfg` condition value: `unk`
2125
--> $DIR/exhaustive-names-values.rs:18:7
@@ -24,6 +28,8 @@ LL | #[cfg(feature = "unk")]
2428
| ^^^^^^^^^^^^^^^
2529
|
2630
= note: expected values for `feature` are: `std`
31+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))`
32+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2733

2834
warning: 3 warnings emitted
2935

‎tests/ui/check-cfg/exhaustive-names-values.full.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: unexpected `cfg` condition value: `value`
@@ -16,6 +18,8 @@ LL | #[cfg(test = "value")]
1618
| help: remove the value
1719
|
1820
= note: no expected value for `test`
21+
= help: to expect this configuration use `--check-cfg=cfg(test, values("value"))`
22+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1923

2024
warning: unexpected `cfg` condition value: `unk`
2125
--> $DIR/exhaustive-names-values.rs:18:7
@@ -24,6 +28,8 @@ LL | #[cfg(feature = "unk")]
2428
| ^^^^^^^^^^^^^^^
2529
|
2630
= note: expected values for `feature` are: `std`
31+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))`
32+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2733

2834
warning: 3 warnings emitted
2935

‎tests/ui/check-cfg/exhaustive-names.exhaustive_names.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎tests/ui/check-cfg/exhaustive-names.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(test = "value")]
77
| help: remove the value
88
|
99
= note: no expected value for `test`
10+
= help: to expect this configuration use `--check-cfg=cfg(test, values("value"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: 1 warning emitted

‎tests/ui/check-cfg/exhaustive-values.without_names.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(test = "value")]
77
| help: remove the value
88
|
99
= note: no expected value for `test`
10+
= help: to expect this configuration use `--check-cfg=cfg(test, values("value"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: 1 warning emitted

‎tests/ui/check-cfg/mix.cfg.stderr

Lines changed: 0 additions & 184 deletions
This file was deleted.

‎tests/ui/check-cfg/mix.stderr

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ warning: unexpected `cfg` condition name: `widnows`
44
LL | #[cfg(widnows)]
55
| ^^^^^^^ help: there is a config with a similar name: `windows`
66
|
7+
= help: to expect this configuration use `--check-cfg=cfg(widnows)`
8+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
79
= note: `#[warn(unexpected_cfgs)]` on by default
810

911
warning: unexpected `cfg` condition value: (none)
@@ -13,6 +15,8 @@ LL | #[cfg(feature)]
1315
| ^^^^^^^- help: specify a config value: `= "foo"`
1416
|
1517
= note: expected values for `feature` are: `foo`
18+
= help: to expect this configuration use `--check-cfg=cfg(feature)`
19+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1620

1721
warning: unexpected `cfg` condition value: `bar`
1822
--> $DIR/mix.rs:23:7
@@ -21,6 +25,8 @@ LL | #[cfg(feature = "bar")]
2125
| ^^^^^^^^^^^^^^^
2226
|
2327
= note: expected values for `feature` are: `foo`
28+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("bar"))`
29+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2430

2531
warning: unexpected `cfg` condition value: `zebra`
2632
--> $DIR/mix.rs:27:7
@@ -29,6 +35,8 @@ LL | #[cfg(feature = "zebra")]
2935
| ^^^^^^^^^^^^^^^^^
3036
|
3137
= note: expected values for `feature` are: `foo`
38+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
39+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
3240

3341
warning: unexpected `cfg` condition name: `uu`
3442
--> $DIR/mix.rs:31:12
@@ -37,12 +45,17 @@ LL | #[cfg_attr(uu, test)]
3745
| ^^
3846
|
3947
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
48+
= help: to expect this configuration use `--check-cfg=cfg(uu)`
49+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
4050

4151
warning: unexpected `cfg` condition name: `widnows`
4252
--> $DIR/mix.rs:40:10
4353
|
4454
LL | cfg!(widnows);
4555
| ^^^^^^^ help: there is a config with a similar name: `windows`
56+
|
57+
= help: to expect this configuration use `--check-cfg=cfg(widnows)`
58+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
4659

4760
warning: unexpected `cfg` condition value: `bar`
4861
--> $DIR/mix.rs:43:10
@@ -51,6 +64,8 @@ LL | cfg!(feature = "bar");
5164
| ^^^^^^^^^^^^^^^
5265
|
5366
= note: expected values for `feature` are: `foo`
67+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("bar"))`
68+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
5469

5570
warning: unexpected `cfg` condition value: `zebra`
5671
--> $DIR/mix.rs:45:10
@@ -59,24 +74,35 @@ LL | cfg!(feature = "zebra");
5974
| ^^^^^^^^^^^^^^^^^
6075
|
6176
= note: expected values for `feature` are: `foo`
77+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
78+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
6279

6380
warning: unexpected `cfg` condition name: `xxx`
6481
--> $DIR/mix.rs:47:10
6582
|
6683
LL | cfg!(xxx = "foo");
6784
| ^^^^^^^^^^^
85+
|
86+
= help: to expect this configuration use `--check-cfg=cfg(xxx, values("foo"))`
87+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
6888

6989
warning: unexpected `cfg` condition name: `xxx`
7090
--> $DIR/mix.rs:49:10
7191
|
7292
LL | cfg!(xxx);
7393
| ^^^
94+
|
95+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
96+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
7497

7598
warning: unexpected `cfg` condition name: `xxx`
7699
--> $DIR/mix.rs:51:14
77100
|
78101
LL | cfg!(any(xxx, windows));
79102
| ^^^
103+
|
104+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
105+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
80106

81107
warning: unexpected `cfg` condition value: `bad`
82108
--> $DIR/mix.rs:53:14
@@ -85,42 +111,62 @@ LL | cfg!(any(feature = "bad", windows));
85111
| ^^^^^^^^^^^^^^^
86112
|
87113
= note: expected values for `feature` are: `foo`
114+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("bad"))`
115+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
88116

89117
warning: unexpected `cfg` condition name: `xxx`
90118
--> $DIR/mix.rs:55:23
91119
|
92120
LL | cfg!(any(windows, xxx));
93121
| ^^^
122+
|
123+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
124+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
94125

95126
warning: unexpected `cfg` condition name: `xxx`
96127
--> $DIR/mix.rs:57:20
97128
|
98129
LL | cfg!(all(unix, xxx));
99130
| ^^^
131+
|
132+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
133+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
100134

101135
warning: unexpected `cfg` condition name: `aa`
102136
--> $DIR/mix.rs:59:14
103137
|
104138
LL | cfg!(all(aa, bb));
105139
| ^^
140+
|
141+
= help: to expect this configuration use `--check-cfg=cfg(aa)`
142+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
106143

107144
warning: unexpected `cfg` condition name: `bb`
108145
--> $DIR/mix.rs:59:18
109146
|
110147
LL | cfg!(all(aa, bb));
111148
| ^^
149+
|
150+
= help: to expect this configuration use `--check-cfg=cfg(bb)`
151+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
112152

113153
warning: unexpected `cfg` condition name: `aa`
114154
--> $DIR/mix.rs:62:14
115155
|
116156
LL | cfg!(any(aa, bb));
117157
| ^^
158+
|
159+
= help: to expect this configuration use `--check-cfg=cfg(aa)`
160+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
118161

119162
warning: unexpected `cfg` condition name: `bb`
120163
--> $DIR/mix.rs:62:18
121164
|
122165
LL | cfg!(any(aa, bb));
123166
| ^^
167+
|
168+
= help: to expect this configuration use `--check-cfg=cfg(bb)`
169+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
124170

125171
warning: unexpected `cfg` condition value: `zebra`
126172
--> $DIR/mix.rs:65:20
@@ -129,12 +175,17 @@ LL | cfg!(any(unix, feature = "zebra"));
129175
| ^^^^^^^^^^^^^^^^^
130176
|
131177
= note: expected values for `feature` are: `foo`
178+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
179+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
132180

133181
warning: unexpected `cfg` condition name: `xxx`
134182
--> $DIR/mix.rs:67:14
135183
|
136184
LL | cfg!(any(xxx, feature = "zebra"));
137185
| ^^^
186+
|
187+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
188+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
138189

139190
warning: unexpected `cfg` condition value: `zebra`
140191
--> $DIR/mix.rs:67:19
@@ -143,18 +194,26 @@ LL | cfg!(any(xxx, feature = "zebra"));
143194
| ^^^^^^^^^^^^^^^^^
144195
|
145196
= note: expected values for `feature` are: `foo`
197+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
198+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
146199

147200
warning: unexpected `cfg` condition name: `xxx`
148201
--> $DIR/mix.rs:70:14
149202
|
150203
LL | cfg!(any(xxx, unix, xxx));
151204
| ^^^
205+
|
206+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
207+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
152208

153209
warning: unexpected `cfg` condition name: `xxx`
154210
--> $DIR/mix.rs:70:25
155211
|
156212
LL | cfg!(any(xxx, unix, xxx));
157213
| ^^^
214+
|
215+
= help: to expect this configuration use `--check-cfg=cfg(xxx)`
216+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
158217

159218
warning: unexpected `cfg` condition value: `zebra`
160219
--> $DIR/mix.rs:73:14
@@ -163,6 +222,8 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
163222
| ^^^^^^^^^^^^^^^^^
164223
|
165224
= note: expected values for `feature` are: `foo`
225+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
226+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
166227

167228
warning: unexpected `cfg` condition value: `zebra`
168229
--> $DIR/mix.rs:73:33
@@ -171,6 +232,8 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
171232
| ^^^^^^^^^^^^^^^^^
172233
|
173234
= note: expected values for `feature` are: `foo`
235+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
236+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
174237

175238
warning: unexpected `cfg` condition value: `zebra`
176239
--> $DIR/mix.rs:73:52
@@ -179,6 +242,8 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
179242
| ^^^^^^^^^^^^^^^^^
180243
|
181244
= note: expected values for `feature` are: `foo`
245+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))`
246+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
182247

183248
warning: 26 warnings emitted
184249

‎tests/ui/check-cfg/no-expected-values.empty.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(feature = "foo")]
77
| help: remove the value
88
|
99
= note: no expected value for `feature`
10+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: unexpected `cfg` condition value: `foo`
@@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")]
1820
| help: remove the value
1921
|
2022
= note: no expected value for `test`
23+
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
24+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2125

2226
warning: 2 warnings emitted
2327

‎tests/ui/check-cfg/no-expected-values.mixed.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(feature = "foo")]
77
| help: remove the value
88
|
99
= note: no expected value for `feature`
10+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: unexpected `cfg` condition value: `foo`
@@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")]
1820
| help: remove the value
1921
|
2022
= note: no expected value for `test`
23+
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
24+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2125

2226
warning: 2 warnings emitted
2327

‎tests/ui/check-cfg/no-expected-values.simple.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(feature = "foo")]
77
| help: remove the value
88
|
99
= note: no expected value for `feature`
10+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: unexpected `cfg` condition value: `foo`
@@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")]
1820
| help: remove the value
1921
|
2022
= note: no expected value for `test`
23+
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
24+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2125

2226
warning: 2 warnings emitted
2327

‎tests/ui/check-cfg/order-independant.values_after.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(a = "unk")]
55
| ^^^^^^^^^
66
|
77
= note: expected values for `a` are: (none), `b`
8+
= help: to expect this configuration use `--check-cfg=cfg(a, values("unk"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/order-independant.values_before.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(a = "unk")]
55
| ^^^^^^^^^
66
|
77
= note: expected values for `a` are: (none), `b`
8+
= help: to expect this configuration use `--check-cfg=cfg(a, values("unk"))`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/stmt-no-ice.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | #[cfg(crossbeam_loom)]
55
| ^^^^^^^^^^^^^^
66
|
77
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
8+
= help: to expect this configuration use `--check-cfg=cfg(crossbeam_loom)`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
810
= note: `#[warn(unexpected_cfgs)]` on by default
911

1012
warning: 1 warning emitted

‎tests/ui/check-cfg/unexpected-cfg-name.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ warning: unexpected `cfg` condition name: `widnows`
44
LL | #[cfg(widnows)]
55
| ^^^^^^^ help: there is a config with a similar name: `windows`
66
|
7+
= help: to expect this configuration use `--check-cfg=cfg(widnows)`
8+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
79
= note: `#[warn(unexpected_cfgs)]` on by default
810

911
warning: 1 warning emitted

‎tests/ui/check-cfg/unexpected-cfg-value.cfg.stderr

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎tests/ui/check-cfg/unexpected-cfg-value.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | #[cfg(feature = "sedre")]
77
| help: there is a expected value with a similar name: `"serde"`
88
|
99
= note: expected values for `feature` are: `full`, `serde`
10+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("sedre"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: unexpected `cfg` condition value: `rand`
@@ -16,6 +18,8 @@ LL | #[cfg(feature = "rand")]
1618
| ^^^^^^^^^^^^^^^^
1719
|
1820
= note: expected values for `feature` are: `full`, `serde`
21+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("rand"))`
22+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1923

2024
warning: 2 warnings emitted
2125

‎tests/ui/check-cfg/well-known-names.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ warning: unexpected `cfg` condition name: `target_oz`
44
LL | #[cfg(target_oz = "linux")]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7+
= help: to expect this configuration use `--check-cfg=cfg(target_oz, values("linux"))`
8+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
79
= note: `#[warn(unexpected_cfgs)]` on by default
810
help: there is a config with a similar name and value
911
|
@@ -17,18 +19,26 @@ LL | #[cfg(features = "foo")]
1719
| ^^^^^^^^^^^^^^^^
1820
|
1921
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `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`
22+
= help: to expect this configuration use `--check-cfg=cfg(features, values("foo"))`
23+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2024

2125
warning: unexpected `cfg` condition name: `feature`
2226
--> $DIR/well-known-names.rs:17:7
2327
|
2428
LL | #[cfg(feature = "foo")]
2529
| ^^^^^^^^^^^^^^^
30+
|
31+
= help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))`
32+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2633

2734
warning: unexpected `cfg` condition name: `uniw`
2835
--> $DIR/well-known-names.rs:21:7
2936
|
3037
LL | #[cfg(uniw)]
3138
| ^^^^ help: there is a config with a similar name: `unix`
39+
|
40+
= help: to expect this configuration use `--check-cfg=cfg(uniw)`
41+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
3242

3343
warning: 4 warnings emitted
3444

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | debug_assertions = "_UNEXPECTED_VALUE",
77
| help: remove the value
88
|
99
= note: no expected value for `debug_assertions`
10+
= help: to expect this configuration use `--check-cfg=cfg(debug_assertions, values("_UNEXPECTED_VALUE"))`
11+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
1012
= note: `#[warn(unexpected_cfgs)]` on by default
1113

1214
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
@@ -18,6 +20,8 @@ LL | doc = "_UNEXPECTED_VALUE",
1820
| help: remove the value
1921
|
2022
= note: no expected value for `doc`
23+
= help: to expect this configuration use `--check-cfg=cfg(doc, values("_UNEXPECTED_VALUE"))`
24+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2125

2226
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
2327
--> $DIR/well-known-values.rs:30:5
@@ -28,6 +32,8 @@ LL | doctest = "_UNEXPECTED_VALUE",
2832
| help: remove the value
2933
|
3034
= note: no expected value for `doctest`
35+
= help: to expect this configuration use `--check-cfg=cfg(doctest, values("_UNEXPECTED_VALUE"))`
36+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
3137

3238
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
3339
--> $DIR/well-known-values.rs:32:5
@@ -38,6 +44,8 @@ LL | miri = "_UNEXPECTED_VALUE",
3844
| help: remove the value
3945
|
4046
= note: no expected value for `miri`
47+
= help: to expect this configuration use `--check-cfg=cfg(miri, values("_UNEXPECTED_VALUE"))`
48+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
4149

4250
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
4351
--> $DIR/well-known-values.rs:34:5
@@ -48,6 +56,8 @@ LL | overflow_checks = "_UNEXPECTED_VALUE",
4856
| help: remove the value
4957
|
5058
= note: no expected value for `overflow_checks`
59+
= help: to expect this configuration use `--check-cfg=cfg(overflow_checks, values("_UNEXPECTED_VALUE"))`
60+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
5161

5262
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
5363
--> $DIR/well-known-values.rs:36:5
@@ -56,6 +66,8 @@ LL | panic = "_UNEXPECTED_VALUE",
5666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
5767
|
5868
= note: expected values for `panic` are: `abort`, `unwind`
69+
= help: to expect this configuration use `--check-cfg=cfg(panic, values("_UNEXPECTED_VALUE"))`
70+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
5971

6072
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
6173
--> $DIR/well-known-values.rs:38:5
@@ -66,6 +78,8 @@ LL | proc_macro = "_UNEXPECTED_VALUE",
6678
| help: remove the value
6779
|
6880
= note: no expected value for `proc_macro`
81+
= help: to expect this configuration use `--check-cfg=cfg(proc_macro, values("_UNEXPECTED_VALUE"))`
82+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
6983

7084
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
7185
--> $DIR/well-known-values.rs:40:5
@@ -74,6 +88,8 @@ LL | relocation_model = "_UNEXPECTED_VALUE",
7488
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7589
|
7690
= note: expected values for `relocation_model` are: `dynamic-no-pic`, `pic`, `pie`, `ropi`, `ropi-rwpi`, `rwpi`, `static`
91+
= help: to expect this configuration use `--check-cfg=cfg(relocation_model, values("_UNEXPECTED_VALUE"))`
92+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
7793

7894
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
7995
--> $DIR/well-known-values.rs:42:5
@@ -82,6 +98,8 @@ LL | sanitize = "_UNEXPECTED_VALUE",
8298
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8399
|
84100
= note: expected values for `sanitize` are: `address`, `cfi`, `hwaddress`, `kcfi`, `kernel-address`, `leak`, `memory`, `memtag`, `safestack`, `shadow-call-stack`, `thread`
101+
= help: to expect this configuration use `--check-cfg=cfg(sanitize, values("_UNEXPECTED_VALUE"))`
102+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
85103

86104
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
87105
--> $DIR/well-known-values.rs:44:5
@@ -90,6 +108,8 @@ LL | target_abi = "_UNEXPECTED_VALUE",
90108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91109
|
92110
= note: expected values for `target_abi` are: ``, `abi64`, `abiv2`, `abiv2hf`, `eabi`, `eabihf`, `elf`, `fortanix`, `ilp32`, `llvm`, `macabi`, `sim`, `softfloat`, `spe`, `uwp`, `vec-extabi`, `x32`
111+
= help: to expect this configuration use `--check-cfg=cfg(target_abi, values("_UNEXPECTED_VALUE"))`
112+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
93113

94114
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
95115
--> $DIR/well-known-values.rs:46:5
@@ -98,6 +118,8 @@ LL | target_arch = "_UNEXPECTED_VALUE",
98118
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99119
|
100120
= 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`
121+
= help: to expect this configuration use `--check-cfg=cfg(target_arch, values("_UNEXPECTED_VALUE"))`
122+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
101123

102124
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
103125
--> $DIR/well-known-values.rs:48:5
@@ -106,6 +128,8 @@ LL | target_endian = "_UNEXPECTED_VALUE",
106128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107129
|
108130
= note: expected values for `target_endian` are: `big`, `little`
131+
= help: to expect this configuration use `--check-cfg=cfg(target_endian, values("_UNEXPECTED_VALUE"))`
132+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
109133

110134
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
111135
--> $DIR/well-known-values.rs:50:5
@@ -114,6 +138,8 @@ LL | target_env = "_UNEXPECTED_VALUE",
114138
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115139
|
116140
= note: expected values for `target_env` are: ``, `eabihf`, `gnu`, `gnueabihf`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc`
141+
= help: to expect this configuration use `--check-cfg=cfg(target_env, values("_UNEXPECTED_VALUE"))`
142+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
117143

118144
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
119145
--> $DIR/well-known-values.rs:52:5
@@ -122,6 +148,8 @@ LL | target_family = "_UNEXPECTED_VALUE",
122148
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123149
|
124150
= note: expected values for `target_family` are: `unix`, `wasm`, `windows`
151+
= help: to expect this configuration use `--check-cfg=cfg(target_family, values("_UNEXPECTED_VALUE"))`
152+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
125153

126154
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
127155
--> $DIR/well-known-values.rs:55:5
@@ -130,6 +158,8 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE",
130158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131159
|
132160
= note: expected values for `target_has_atomic` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr`
161+
= help: to expect this configuration use `--check-cfg=cfg(target_has_atomic, values("_UNEXPECTED_VALUE"))`
162+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
133163

134164
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
135165
--> $DIR/well-known-values.rs:57:5
@@ -138,6 +168,8 @@ LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
138168
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139169
|
140170
= note: expected values for `target_has_atomic_equal_alignment` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr`
171+
= help: to expect this configuration use `--check-cfg=cfg(target_has_atomic_equal_alignment, values("_UNEXPECTED_VALUE"))`
172+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
141173

142174
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
143175
--> $DIR/well-known-values.rs:59:5
@@ -146,6 +178,8 @@ LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
146178
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147179
|
148180
= note: expected values for `target_has_atomic_load_store` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr`
181+
= help: to expect this configuration use `--check-cfg=cfg(target_has_atomic_load_store, values("_UNEXPECTED_VALUE"))`
182+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
149183

150184
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
151185
--> $DIR/well-known-values.rs:61:5
@@ -154,6 +188,8 @@ LL | target_os = "_UNEXPECTED_VALUE",
154188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155189
|
156190
= 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`
191+
= help: to expect this configuration use `--check-cfg=cfg(target_os, values("_UNEXPECTED_VALUE"))`
192+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
157193

158194
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
159195
--> $DIR/well-known-values.rs:63:5
@@ -162,6 +198,8 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE",
162198
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163199
|
164200
= note: expected values for `target_pointer_width` are: `16`, `32`, `64`
201+
= help: to expect this configuration use `--check-cfg=cfg(target_pointer_width, values("_UNEXPECTED_VALUE"))`
202+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
165203

166204
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
167205
--> $DIR/well-known-values.rs:65:5
@@ -172,6 +210,8 @@ LL | target_thread_local = "_UNEXPECTED_VALUE",
172210
| help: remove the value
173211
|
174212
= note: no expected value for `target_thread_local`
213+
= help: to expect this configuration use `--check-cfg=cfg(target_thread_local, values("_UNEXPECTED_VALUE"))`
214+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
175215

176216
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
177217
--> $DIR/well-known-values.rs:67:5
@@ -180,6 +220,8 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
180220
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
181221
|
182222
= note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, `wrs`
223+
= help: to expect this configuration use `--check-cfg=cfg(target_vendor, values("_UNEXPECTED_VALUE"))`
224+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
183225

184226
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
185227
--> $DIR/well-known-values.rs:69:5
@@ -190,6 +232,8 @@ LL | test = "_UNEXPECTED_VALUE",
190232
| help: remove the value
191233
|
192234
= note: no expected value for `test`
235+
= help: to expect this configuration use `--check-cfg=cfg(test, values("_UNEXPECTED_VALUE"))`
236+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
193237

194238
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
195239
--> $DIR/well-known-values.rs:71:5
@@ -200,6 +244,8 @@ LL | unix = "_UNEXPECTED_VALUE",
200244
| help: remove the value
201245
|
202246
= note: no expected value for `unix`
247+
= help: to expect this configuration use `--check-cfg=cfg(unix, values("_UNEXPECTED_VALUE"))`
248+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
203249

204250
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
205251
--> $DIR/well-known-values.rs:73:5
@@ -210,6 +256,8 @@ LL | windows = "_UNEXPECTED_VALUE",
210256
| help: remove the value
211257
|
212258
= note: no expected value for `windows`
259+
= help: to expect this configuration use `--check-cfg=cfg(windows, values("_UNEXPECTED_VALUE"))`
260+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
213261

214262
warning: unexpected `cfg` condition value: `linuz`
215263
--> $DIR/well-known-values.rs:79:7
@@ -220,6 +268,8 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
220268
| help: there is a expected value with a similar name: `"linux"`
221269
|
222270
= 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`
271+
= help: to expect this configuration use `--check-cfg=cfg(target_os, values("linuz"))`
272+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
223273

224274
warning: 25 warnings emitted
225275

0 commit comments

Comments
 (0)
Please sign in to comment.