Skip to content

Commit c5ea75a

Browse files
committed
Filter well known names from check-cfg diagnostics
1 parent c08cc61 commit c5ea75a

24 files changed

+98
-42
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,

tests/ui/check-cfg/allow-same-level.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//@ check-pass
1111
//@ no-auto-check-cfg
1212
//@ compile-flags: --check-cfg=cfg() --cfg=unknown_but_active_cfg
13-
//@ normalize-stderr: "expected names are: .*" -> "..."
1413

1514
#[allow(unexpected_cfgs)]
1615
#[cfg(FALSE)]

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
warning: unexpected `cfg` condition name: `FALSE`
2-
--> $DIR/allow-same-level.rs:16:7
2+
--> $DIR/allow-same-level.rs:15:7
33
|
44
LL | #[cfg(FALSE)]
55
| ^^^^^
66
|
7-
= help: ...
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

1211
warning: unexpected `cfg` condition name: `unknown_but_active_cfg`
13-
--> $DIR/allow-same-level.rs:21:7
12+
--> $DIR/allow-same-level.rs:20:7
1413
|
1514
LL | #[cfg(unknown_but_active_cfg)]
1615
| ^^^^^^^^^^^^^^^^^^^^^^

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

tests/ui/check-cfg/raw-keywords.edition2015.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
1414
LL | #[cfg(r#false)]
1515
| ^^^^^^^
1616
|
17-
= help: expected names are: `async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `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`, `r#true`, `ub_checks`, `unix`, and `windows`
17+
= help: expected names are: `async`, `edition2015`, `edition2021`, and `r#true` and 30 more
1818
= help: to expect this configuration use `--check-cfg=cfg(r#false)`
1919
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2020

tests/ui/check-cfg/raw-keywords.edition2021.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
1414
LL | #[cfg(r#false)]
1515
| ^^^^^^^
1616
|
17-
= help: expected names are: `r#async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `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`, `r#true`, `ub_checks`, `unix`, and `windows`
17+
= help: expected names are: `r#async`, `edition2015`, `edition2021`, and `r#true` and 30 more
1818
= help: to expect this configuration use `--check-cfg=cfg(r#false)`
1919
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2020

0 commit comments

Comments
 (0)