Skip to content

Commit 5c236b4

Browse files
authored
Unrolled build for rust-lang#136016
Rollup merge of rust-lang#136016 - Urgau:check-cfg-allow-test-improv, r=jieyouxu Improve check-cfg expected names diagnostic This PR improves the check-cfg `allow-same-level` test by ~~normalizing it's output and by~~ adding more context to the test. It also filters the well known cfgs from the `expected names are` note, as to reduce the size of the diagnostic. Users can still find the full list on the [rustc book](https://doc.rust-lang.org/nightly/rustc/check-cfg.html#well-known-names-and-values), which is reinforced for Cargo users by adding a note in the Cargo check-cfg specific section. Fixes rust-lang#135995 r? `@jieyouxu`
2 parents 6fb0358 + 74223e4 commit 5c236b4

25 files changed

+123
-43
lines changed

compiler/rustc_lint/src/early/diagnostics/check_cfg.rs

+25-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,35 @@ use crate::lints;
1010

1111
const MAX_CHECK_CFG_NAMES_OR_VALUES: usize = 35;
1212

13+
enum FilterWellKnownNames {
14+
Yes,
15+
No,
16+
}
17+
1318
fn sort_and_truncate_possibilities(
1419
sess: &Session,
1520
mut possibilities: Vec<Symbol>,
21+
filter_well_known_names: FilterWellKnownNames,
1622
) -> (Vec<Symbol>, usize) {
23+
let possibilities_len = possibilities.len();
24+
1725
let n_possibilities = if sess.opts.unstable_opts.check_cfg_all_expected {
1826
possibilities.len()
1927
} else {
28+
match filter_well_known_names {
29+
FilterWellKnownNames::Yes => {
30+
possibilities.retain(|cfg_name| {
31+
!sess.psess.check_config.well_known_names.contains(cfg_name)
32+
});
33+
}
34+
FilterWellKnownNames::No => {}
35+
};
2036
std::cmp::min(possibilities.len(), MAX_CHECK_CFG_NAMES_OR_VALUES)
2137
};
2238

2339
possibilities.sort_by(|s1, s2| s1.as_str().cmp(s2.as_str()));
2440

25-
let and_more = possibilities.len().saturating_sub(n_possibilities);
41+
let and_more = possibilities_len.saturating_sub(n_possibilities);
2642
possibilities.truncate(n_possibilities);
2743
(possibilities, and_more)
2844
}
@@ -198,8 +214,10 @@ pub(super) fn unexpected_cfg_name(
198214
} else {
199215
vec![]
200216
};
217+
218+
let (possibilities, and_more) =
219+
sort_and_truncate_possibilities(sess, possibilities, FilterWellKnownNames::Yes);
201220
let expected_names = if !possibilities.is_empty() {
202-
let (possibilities, and_more) = sort_and_truncate_possibilities(sess, possibilities);
203221
let possibilities: Vec<_> =
204222
possibilities.into_iter().map(|s| Ident::new(s, name_span)).collect();
205223
Some(lints::unexpected_cfg_name::ExpectedNames {
@@ -269,8 +287,11 @@ pub(super) fn unexpected_cfg_value(
269287
// for names as the possibilities could be very long
270288
let code_sugg = if !possibilities.is_empty() {
271289
let expected_values = {
272-
let (possibilities, and_more) =
273-
sort_and_truncate_possibilities(sess, possibilities.clone());
290+
let (possibilities, and_more) = sort_and_truncate_possibilities(
291+
sess,
292+
possibilities.clone(),
293+
FilterWellKnownNames::No,
294+
);
274295
lints::unexpected_cfg_value::ExpectedValues {
275296
name,
276297
have_none_possibility,

src/doc/rustc/src/check-cfg/cargo-specifics.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ the `unexpected_cfgs` lint and `--check-cfg` flag. It is not intended to provide
1313
individual details, for that refer to the [`--check-cfg` documentation](../check-cfg.md) and
1414
to the [Cargo book](../../cargo/index.html).
1515

16+
> The full list of well known cfgs (aka builtins) can be found under [Checking conditional configurations / Well known names and values](../check-cfg.md#well-known-names-and-values).
17+
1618
## Cargo feature
1719

1820
*See the [`[features]` section in the Cargo book][cargo-features] for more details.*
+14-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
// This test check that #[allow(unexpected_cfgs)] doesn't work if put on the same level
1+
// This test check that #[allow(unexpected_cfgs)] **doesn't work**
2+
// when put on the same level as the #[cfg] attribute.
3+
//
4+
// It should work, but due to interactions between how #[cfg]s are
5+
// expanded, the lint machinery and the check-cfg impl, we
6+
// miss the #[allow], althrough we probably shoudln't.
7+
//
8+
// cf. https://github.com/rust-lang/rust/issues/124735
29
//
310
//@ check-pass
411
//@ no-auto-check-cfg
5-
//@ compile-flags: --check-cfg=cfg()
12+
//@ compile-flags: --check-cfg=cfg() --cfg=unknown_but_active_cfg
613

714
#[allow(unexpected_cfgs)]
815
#[cfg(FALSE)]
916
//~^ WARNING unexpected `cfg` condition name
1017
fn bar() {}
1118

19+
#[allow(unexpected_cfgs)]
20+
#[cfg(unknown_but_active_cfg)]
21+
//~^ WARNING unexpected `cfg` condition name
22+
fn bar() {}
23+
1224
fn main() {}
+11-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
warning: unexpected `cfg` condition name: `FALSE`
2-
--> $DIR/allow-same-level.rs:8:7
2+
--> $DIR/allow-same-level.rs:15:7
33
|
44
LL | #[cfg(FALSE)]
55
| ^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
87
= help: to expect this configuration use `--check-cfg=cfg(FALSE)`
98
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
109
= note: `#[warn(unexpected_cfgs)]` on by default
1110

12-
warning: 1 warning emitted
11+
warning: unexpected `cfg` condition name: `unknown_but_active_cfg`
12+
--> $DIR/allow-same-level.rs:20:7
13+
|
14+
LL | #[cfg(unknown_but_active_cfg)]
15+
| ^^^^^^^^^^^^^^^^^^^^^^
16+
|
17+
= help: to expect this configuration use `--check-cfg=cfg(unknown_but_active_cfg)`
18+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
19+
20+
warning: 2 warnings emitted
1321

tests/ui/check-cfg/cargo-build-script.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `has_foo`
44
LL | #[cfg(has_foo)]
55
| ^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `has_bar`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
7+
= help: expected names are: `has_bar` and 30 more
88
= help: consider using a Cargo feature instead
99
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
1010
[lints.rust]

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: unexpected `cfg` condition value: `serde`
2-
--> $DIR/cargo-feature.rs:14:7
2+
--> $DIR/cargo-feature.rs:15:7
33
|
44
LL | #[cfg(feature = "serde")]
55
| ^^^^^^^^^^^^^^^^^ help: remove the condition
@@ -10,7 +10,7 @@ LL | #[cfg(feature = "serde")]
1010
= note: `#[warn(unexpected_cfgs)]` on by default
1111

1212
warning: unexpected `cfg` condition value: (none)
13-
--> $DIR/cargo-feature.rs:18:7
13+
--> $DIR/cargo-feature.rs:19:7
1414
|
1515
LL | #[cfg(feature)]
1616
| ^^^^^^^ help: remove the condition
@@ -20,12 +20,12 @@ LL | #[cfg(feature)]
2020
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
2121

2222
warning: unexpected `cfg` condition name: `tokio_unstable`
23-
--> $DIR/cargo-feature.rs:22:7
23+
--> $DIR/cargo-feature.rs:23:7
2424
|
2525
LL | #[cfg(tokio_unstable)]
2626
| ^^^^^^^^^^^^^^
2727
|
28-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
28+
= help: expected names are: `docsrs`, `feature`, and `test` and 30 more
2929
= help: consider using a Cargo feature instead
3030
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
3131
[lints.rust]
@@ -34,7 +34,7 @@ LL | #[cfg(tokio_unstable)]
3434
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
3535

3636
warning: unexpected `cfg` condition name: `CONFIG_NVME`
37-
--> $DIR/cargo-feature.rs:26:7
37+
--> $DIR/cargo-feature.rs:27:7
3838
|
3939
LL | #[cfg(CONFIG_NVME = "m")]
4040
| ^^^^^^^^^^^^^^^^^

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

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//@ no-auto-check-cfg
77
//@ revisions: some none
88
//@ rustc-env:CARGO_CRATE_NAME=foo
9+
//@ compile-flags: --check-cfg=cfg(docsrs,test)
910
//@ [none]compile-flags: --check-cfg=cfg(feature,values())
1011
//@ [some]compile-flags: --check-cfg=cfg(feature,values("bitcode"))
1112
//@ [some]compile-flags: --check-cfg=cfg(CONFIG_NVME,values("y"))

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: unexpected `cfg` condition value: `serde`
2-
--> $DIR/cargo-feature.rs:14:7
2+
--> $DIR/cargo-feature.rs:15:7
33
|
44
LL | #[cfg(feature = "serde")]
55
| ^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | #[cfg(feature = "serde")]
1010
= note: `#[warn(unexpected_cfgs)]` on by default
1111

1212
warning: unexpected `cfg` condition value: (none)
13-
--> $DIR/cargo-feature.rs:18:7
13+
--> $DIR/cargo-feature.rs:19:7
1414
|
1515
LL | #[cfg(feature)]
1616
| ^^^^^^^- help: specify a config value: `= "bitcode"`
@@ -20,12 +20,12 @@ LL | #[cfg(feature)]
2020
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
2121

2222
warning: unexpected `cfg` condition name: `tokio_unstable`
23-
--> $DIR/cargo-feature.rs:22:7
23+
--> $DIR/cargo-feature.rs:23:7
2424
|
2525
LL | #[cfg(tokio_unstable)]
2626
| ^^^^^^^^^^^^^^
2727
|
28-
= help: expected names are: `CONFIG_NVME`, `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
28+
= help: expected names are: `CONFIG_NVME`, `docsrs`, `feature`, and `test` and 30 more
2929
= help: consider using a Cargo feature instead
3030
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
3131
[lints.rust]
@@ -34,7 +34,7 @@ LL | #[cfg(tokio_unstable)]
3434
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
3535

3636
warning: unexpected `cfg` condition value: `m`
37-
--> $DIR/cargo-feature.rs:26:7
37+
--> $DIR/cargo-feature.rs:27:7
3838
|
3939
LL | #[cfg(CONFIG_NVME = "m")]
4040
| ^^^^^^^^^^^^^^---

tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `value`
44
LL | #[cfg(value)]
55
| ^^^^^
66
|
7-
= help: expected names are: `bar`, `bee`, `clippy`, `cow`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
7+
= help: expected names are: `bar`, `bee`, `cow`, and `foo` and 30 more
88
= help: to expect this configuration use `--check-cfg=cfg(value)`
99
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
1010
= note: `#[warn(unexpected_cfgs)]` on by default

tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_value`
44
LL | #[cfg(my_value)]
55
| ^^^^^^^^
66
|
7-
= help: expected names are: `bar`, `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
7+
= help: expected names are: `bar` and `foo` and 30 more
88
= help: to expect this configuration use `--check-cfg=cfg(my_value)`
99
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
1010
= note: `#[warn(unexpected_cfgs)]` on by default

tests/ui/check-cfg/cfg-value-for-cfg-name.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `linux`
44
LL | #[cfg(linux)]
55
| ^^^^^ help: found config with similar value: `target_os = "linux"`
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
87
= help: to expect this configuration use `--check-cfg=cfg(linux)`
98
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
109
= note: `#[warn(unexpected_cfgs)]` on by default

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

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `target_architecture`
44
LL | #[cfg(target(os = "linux", architecture = "arm"))]
55
| ^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
87
= help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))`
98
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
109
= note: `#[warn(unexpected_cfgs)]` on by default

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

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `unknown_key`
44
LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
87
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
98
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
109
= note: `#[warn(unexpected_cfgs)]` on by default

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
44
LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
7+
= help: expected names are: `feature` and 30 more
88
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
99
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
1010
= note: `#[warn(unexpected_cfgs)]` on by default

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
44
LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
7+
= help: expected names are: `feature` and 30 more
88
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
99
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
1010
= note: `#[warn(unexpected_cfgs)]` on by default

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

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `unknown_key`
44
LL | #[cfg(unknown_key = "value")]
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
87
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
98
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
109
= note: `#[warn(unexpected_cfgs)]` on by default

tests/ui/check-cfg/mix.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ warning: unexpected `cfg` condition name: `uu`
4444
LL | #[cfg_attr(uu, unix)]
4545
| ^^
4646
|
47-
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
47+
= help: expected names are: `feature` and 30 more
4848
= help: to expect this configuration use `--check-cfg=cfg(uu)`
4949
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
5050

0 commit comments

Comments
 (0)