diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/ui/check-cfg | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/check-cfg')
58 files changed, 1057 insertions, 810 deletions
diff --git a/tests/ui/check-cfg/allow-same-level.stderr b/tests/ui/check-cfg/allow-same-level.stderr index b0c459fab..7f0faa070 100644 --- a/tests/ui/check-cfg/allow-same-level.stderr +++ b/tests/ui/check-cfg/allow-same-level.stderr @@ -4,7 +4,9 @@ warning: unexpected `cfg` condition name: `FALSE` LL | #[cfg(FALSE)] | ^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(FALSE)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted diff --git a/tests/ui/check-cfg/cargo-feature.none.stderr b/tests/ui/check-cfg/cargo-feature.none.stderr new file mode 100644 index 000000000..44c8f7e30 --- /dev/null +++ b/tests/ui/check-cfg/cargo-feature.none.stderr @@ -0,0 +1,31 @@ +warning: unexpected `cfg` condition name: `feature` + --> $DIR/cargo-feature.rs:13:7 + | +LL | #[cfg(feature = "serde")] + | ^^^^^^^^^^^^^^^^^ + | + = help: consider defining some features in `Cargo.toml` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition name: `tokio_unstable` + --> $DIR/cargo-feature.rs:18:7 + | +LL | #[cfg(tokio_unstable)] + | ^^^^^^^^^^^^^^ + | + = 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` + = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `CONFIG_NVME` + --> $DIR/cargo-feature.rs:22:7 + | +LL | #[cfg(CONFIG_NVME = "m")] + | ^^^^^^^^^^^^^^^^^ + | + = 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` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: 3 warnings emitted + diff --git a/tests/ui/check-cfg/cargo-feature.rs b/tests/ui/check-cfg/cargo-feature.rs new file mode 100644 index 000000000..fe343d0a6 --- /dev/null +++ b/tests/ui/check-cfg/cargo-feature.rs @@ -0,0 +1,27 @@ +// This test checks that when no features are passed by Cargo we +// suggest adding some in the Cargo.toml instead of vomitting a +// list of all the expected names +// +// check-pass +// revisions: some none +// rustc-env:CARGO=/usr/bin/cargo +// compile-flags: --check-cfg=cfg() -Z unstable-options +// [some]compile-flags: --check-cfg=cfg(feature,values("bitcode")) +// [some]compile-flags: --check-cfg=cfg(CONFIG_NVME,values("y")) +// [none]error-pattern:Cargo.toml + +#[cfg(feature = "serde")] +//[none]~^ WARNING unexpected `cfg` condition name +//[some]~^^ WARNING unexpected `cfg` condition value +fn ser() {} + +#[cfg(tokio_unstable)] +//~^ WARNING unexpected `cfg` condition name +fn tokio() {} + +#[cfg(CONFIG_NVME = "m")] +//[none]~^ WARNING unexpected `cfg` condition name +//[some]~^^ WARNING unexpected `cfg` condition value +fn tokio() {} + +fn main() {} diff --git a/tests/ui/check-cfg/cargo-feature.some.stderr b/tests/ui/check-cfg/cargo-feature.some.stderr new file mode 100644 index 000000000..92d63d015 --- /dev/null +++ b/tests/ui/check-cfg/cargo-feature.some.stderr @@ -0,0 +1,35 @@ +warning: unexpected `cfg` condition value: `serde` + --> $DIR/cargo-feature.rs:13:7 + | +LL | #[cfg(feature = "serde")] + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `bitcode` + = help: consider adding `serde` as a feature in `Cargo.toml` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition name: `tokio_unstable` + --> $DIR/cargo-feature.rs:18:7 + | +LL | #[cfg(tokio_unstable)] + | ^^^^^^^^^^^^^^ + | + = 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` + = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(tokio_unstable)");` to the top of a `build.rs` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `m` + --> $DIR/cargo-feature.rs:22:7 + | +LL | #[cfg(CONFIG_NVME = "m")] + | ^^^^^^^^^^^^^^--- + | | + | help: there is a expected value with a similar name: `"y"` + | + = note: expected values for `CONFIG_NVME` are: `y` + = 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` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: 3 warnings emitted + diff --git a/tests/ui/check-cfg/compact-names.stderr b/tests/ui/check-cfg/compact-names.stderr index b0228774b..dfa26f5dd 100644 --- a/tests/ui/check-cfg/compact-names.stderr +++ b/tests/ui/check-cfg/compact-names.stderr @@ -4,7 +4,9 @@ warning: unexpected `cfg` condition name: `target_architecture` LL | #[cfg(target(os = "linux", architecture = "arm"))] | ^^^^^^^^^^^^^^^^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted diff --git a/tests/ui/check-cfg/compact-values.rs b/tests/ui/check-cfg/compact-values.rs index 13c072fe9..80cf75d27 100644 --- a/tests/ui/check-cfg/compact-values.rs +++ b/tests/ui/check-cfg/compact-values.rs @@ -8,7 +8,7 @@ #[cfg(target(os = "linux", arch = "arm"))] pub fn expected() {} -#[cfg(target(os = "linux", arch = "X"))] +#[cfg(target(os = "linux", pointer_width = "X"))] //~^ WARNING unexpected `cfg` condition value pub fn unexpected() {} diff --git a/tests/ui/check-cfg/compact-values.stderr b/tests/ui/check-cfg/compact-values.stderr index bb2f4915b..10276af4d 100644 --- a/tests/ui/check-cfg/compact-values.stderr +++ b/tests/ui/check-cfg/compact-values.stderr @@ -1,10 +1,12 @@ warning: unexpected `cfg` condition value: `X` --> $DIR/compact-values.rs:11:28 | -LL | #[cfg(target(os = "linux", arch = "X"))] - | ^^^^^^^^^^ +LL | #[cfg(target(os = "linux", pointer_width = "X"))] + | ^^^^^^^^^^^^^^^^^^^ | - = 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` + = note: expected values for `target_pointer_width` are: `16`, `32`, `64` + = help: to expect this configuration use `--check-cfg=cfg(target_pointer_width, values("X"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted diff --git a/tests/ui/check-cfg/concat-values.stderr b/tests/ui/check-cfg/concat-values.stderr index da2bd7d6a..dec43f5bd 100644 --- a/tests/ui/check-cfg/concat-values.stderr +++ b/tests/ui/check-cfg/concat-values.stderr @@ -5,6 +5,8 @@ LL | #[cfg(my_cfg)] | ^^^^^^ | = note: expected values for `my_cfg` are: `bar`, `foo` + = help: to expect this configuration use `--check-cfg=cfg(my_cfg)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `unk` @@ -14,6 +16,8 @@ LL | #[cfg(my_cfg = "unk")] | ^^^^^^^^^^^^^^ | = note: expected values for `my_cfg` are: `bar`, `foo` + = help: to expect this configuration use `--check-cfg=cfg(my_cfg, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: 2 warnings emitted diff --git a/tests/ui/check-cfg/diagnotics.cargo.stderr b/tests/ui/check-cfg/diagnotics.cargo.stderr new file mode 100644 index 000000000..05c52bf59 --- /dev/null +++ b/tests/ui/check-cfg/diagnotics.cargo.stderr @@ -0,0 +1,71 @@ +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:7:7 + | +LL | #[cfg(featur)] + | ^^^^^^ help: there is a config with a similar name: `feature` + | + = help: expected values for `feature` are: `foo` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:11:7 + | +LL | #[cfg(featur = "foo")] + | ^^^^^^^^^^^^^^ + | + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration +help: there is a config with a similar name and value + | +LL | #[cfg(feature = "foo")] + | ~~~~~~~ + +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:15:7 + | +LL | #[cfg(featur = "fo")] + | ^^^^^^^^^^^^^ + | + = help: expected values for `feature` are: `foo` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration +help: there is a config with a similar name and different values + | +LL | #[cfg(feature = "foo")] + | ~~~~~~~~~~~~~~~ + +warning: unexpected `cfg` condition name: `no_value` + --> $DIR/diagnotics.rs:22:7 + | +LL | #[cfg(no_value)] + | ^^^^^^^^ help: there is a config with a similar name: `no_values` + | + = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(no_value)");` to the top of a `build.rs` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `no_value` + --> $DIR/diagnotics.rs:26:7 + | +LL | #[cfg(no_value = "foo")] + | ^^^^^^^^^^^^^^^^ + | + = 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` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration +help: there is a config with a similar name and no value + | +LL | #[cfg(no_values)] + | ~~~~~~~~~ + +warning: unexpected `cfg` condition value: `bar` + --> $DIR/diagnotics.rs:30:7 + | +LL | #[cfg(no_values = "bar")] + | ^^^^^^^^^-------- + | | + | help: remove the value + | + = note: no expected value for `no_values` + = 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` + = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration + +warning: 6 warnings emitted + diff --git a/tests/ui/check-cfg/diagnotics.rs b/tests/ui/check-cfg/diagnotics.rs index 45875bddc..33073f05f 100644 --- a/tests/ui/check-cfg/diagnotics.rs +++ b/tests/ui/check-cfg/diagnotics.rs @@ -1,4 +1,7 @@ // check-pass +// revisions: cargo rustc +// [rustc]unset-rustc-env:CARGO +// [cargo]rustc-env:CARGO=/usr/bin/cargo // compile-flags: --check-cfg=cfg(feature,values("foo")) --check-cfg=cfg(no_values) -Z unstable-options #[cfg(featur)] diff --git a/tests/ui/check-cfg/diagnotics.rustc.stderr b/tests/ui/check-cfg/diagnotics.rustc.stderr new file mode 100644 index 000000000..2b1129a39 --- /dev/null +++ b/tests/ui/check-cfg/diagnotics.rustc.stderr @@ -0,0 +1,74 @@ +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:7:7 + | +LL | #[cfg(featur)] + | ^^^^^^ help: there is a config with a similar name: `feature` + | + = help: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(featur)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:11:7 + | +LL | #[cfg(featur = "foo")] + | ^^^^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(featur, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration +help: there is a config with a similar name and value + | +LL | #[cfg(feature = "foo")] + | ~~~~~~~ + +warning: unexpected `cfg` condition name: `featur` + --> $DIR/diagnotics.rs:15:7 + | +LL | #[cfg(featur = "fo")] + | ^^^^^^^^^^^^^ + | + = help: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(featur, values("fo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration +help: there is a config with a similar name and different values + | +LL | #[cfg(feature = "foo")] + | ~~~~~~~~~~~~~~~ + +warning: unexpected `cfg` condition name: `no_value` + --> $DIR/diagnotics.rs:22:7 + | +LL | #[cfg(no_value)] + | ^^^^^^^^ help: there is a config with a similar name: `no_values` + | + = help: to expect this configuration use `--check-cfg=cfg(no_value)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `no_value` + --> $DIR/diagnotics.rs:26:7 + | +LL | #[cfg(no_value = "foo")] + | ^^^^^^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(no_value, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration +help: there is a config with a similar name and no value + | +LL | #[cfg(no_values)] + | ~~~~~~~~~ + +warning: unexpected `cfg` condition value: `bar` + --> $DIR/diagnotics.rs:30:7 + | +LL | #[cfg(no_values = "bar")] + | ^^^^^^^^^-------- + | | + | help: remove the value + | + = note: no expected value for `no_values` + = help: to expect this configuration use `--check-cfg=cfg(no_values, values("bar"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: 6 warnings emitted + diff --git a/tests/ui/check-cfg/diagnotics.stderr b/tests/ui/check-cfg/diagnotics.stderr deleted file mode 100644 index 31c0db03a..000000000 --- a/tests/ui/check-cfg/diagnotics.stderr +++ /dev/null @@ -1,61 +0,0 @@ -warning: unexpected `cfg` condition name: `featur` - --> $DIR/diagnotics.rs:4:7 - | -LL | #[cfg(featur)] - | ^^^^^^ help: there is a config with a similar name: `feature` - | - = help: expected values for `feature` are: `foo` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition name: `featur` - --> $DIR/diagnotics.rs:8:7 - | -LL | #[cfg(featur = "foo")] - | ^^^^^^^^^^^^^^ - | -help: there is a config with a similar name and value - | -LL | #[cfg(feature = "foo")] - | ~~~~~~~ - -warning: unexpected `cfg` condition name: `featur` - --> $DIR/diagnotics.rs:12:7 - | -LL | #[cfg(featur = "fo")] - | ^^^^^^^^^^^^^ - | - = help: expected values for `feature` are: `foo` -help: there is a config with a similar name and different values - | -LL | #[cfg(feature = "foo")] - | ~~~~~~~~~~~~~~~ - -warning: unexpected `cfg` condition name: `no_value` - --> $DIR/diagnotics.rs:19:7 - | -LL | #[cfg(no_value)] - | ^^^^^^^^ help: there is a config with a similar name: `no_values` - -warning: unexpected `cfg` condition name: `no_value` - --> $DIR/diagnotics.rs:23:7 - | -LL | #[cfg(no_value = "foo")] - | ^^^^^^^^^^^^^^^^ - | -help: there is a config with a similar name and no value - | -LL | #[cfg(no_values)] - | ~~~~~~~~~ - -warning: unexpected `cfg` condition value: `bar` - --> $DIR/diagnotics.rs:27:7 - | -LL | #[cfg(no_values = "bar")] - | ^^^^^^^^^-------- - | | - | help: remove the value - | - = note: no expected value for `no_values` - -warning: 6 warnings emitted - diff --git a/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr b/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr index 53ccc0f4d..27af82120 100644 --- a/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr +++ b/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr @@ -1,14 +1,16 @@ warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names-values.rs:12:7 + --> $DIR/exhaustive-names-values.rs:10:7 | LL | #[cfg(unknown_key = "value")] | ^^^^^^^^^^^^^^^^^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-names-values.rs:16:7 + --> $DIR/exhaustive-names-values.rs:14:7 | LL | #[cfg(test = "value")] | ^^^^---------- @@ -16,10 +18,26 @@ LL | #[cfg(test = "value")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `empty_cfg` as condition name +warning: unexpected `cfg` condition name: `feature` + --> $DIR/exhaustive-names-values.rs:18:7 | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names +LL | #[cfg(feature = "unk")] + | ^^^^^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `feature` + --> $DIR/exhaustive-names-values.rs:25:7 + | +LL | #[cfg(feature = "std")] + | ^^^^^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(feature, values("std"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: 3 warnings emitted +warning: 4 warnings emitted diff --git a/tests/ui/check-cfg/exhaustive-names-values.empty_names_values.stderr b/tests/ui/check-cfg/exhaustive-names-values.empty_names_values.stderr deleted file mode 100644 index 5e8b74054..000000000 --- a/tests/ui/check-cfg/exhaustive-names-values.empty_names_values.stderr +++ /dev/null @@ -1,25 +0,0 @@ -warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names-values.rs:12:7 - | -LL | #[cfg(unknown_key = "value")] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-names-values.rs:16:7 - | -LL | #[cfg(test = "value")] - | ^^^^---------- - | | - | help: remove the value - | - = note: no expected value for `test` - -warning: unexpected `empty_names_values` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: 3 warnings emitted - diff --git a/tests/ui/check-cfg/exhaustive-names-values.feature.stderr b/tests/ui/check-cfg/exhaustive-names-values.feature.stderr index 7705a665e..a5aa80ef8 100644 --- a/tests/ui/check-cfg/exhaustive-names-values.feature.stderr +++ b/tests/ui/check-cfg/exhaustive-names-values.feature.stderr @@ -1,14 +1,16 @@ warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names-values.rs:12:7 + --> $DIR/exhaustive-names-values.rs:10:7 | LL | #[cfg(unknown_key = "value")] | ^^^^^^^^^^^^^^^^^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-names-values.rs:16:7 + --> $DIR/exhaustive-names-values.rs:14:7 | LL | #[cfg(test = "value")] | ^^^^---------- @@ -16,18 +18,18 @@ LL | #[cfg(test = "value")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition value: `unk` - --> $DIR/exhaustive-names-values.rs:20:7 + --> $DIR/exhaustive-names-values.rs:18:7 | LL | #[cfg(feature = "unk")] | ^^^^^^^^^^^^^^^ | = note: expected values for `feature` are: `std` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected condition value `` for condition name `feature` - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected values - -warning: 4 warnings emitted +warning: 3 warnings emitted diff --git a/tests/ui/check-cfg/exhaustive-names-values.full.stderr b/tests/ui/check-cfg/exhaustive-names-values.full.stderr index f0224a2e3..a5aa80ef8 100644 --- a/tests/ui/check-cfg/exhaustive-names-values.full.stderr +++ b/tests/ui/check-cfg/exhaustive-names-values.full.stderr @@ -1,14 +1,16 @@ warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names-values.rs:12:7 + --> $DIR/exhaustive-names-values.rs:10:7 | LL | #[cfg(unknown_key = "value")] | ^^^^^^^^^^^^^^^^^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-names-values.rs:16:7 + --> $DIR/exhaustive-names-values.rs:14:7 | LL | #[cfg(test = "value")] | ^^^^---------- @@ -16,18 +18,18 @@ LL | #[cfg(test = "value")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition value: `unk` - --> $DIR/exhaustive-names-values.rs:20:7 + --> $DIR/exhaustive-names-values.rs:18:7 | LL | #[cfg(feature = "unk")] | ^^^^^^^^^^^^^^^ | = note: expected values for `feature` are: `std` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `full` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: 4 warnings emitted +warning: 3 warnings emitted diff --git a/tests/ui/check-cfg/exhaustive-names-values.rs b/tests/ui/check-cfg/exhaustive-names-values.rs index f553d93ca..956992a1e 100644 --- a/tests/ui/check-cfg/exhaustive-names-values.rs +++ b/tests/ui/check-cfg/exhaustive-names-values.rs @@ -1,10 +1,8 @@ -// Check warning for unexpected cfg in the code and in the CLI -// arguments (here the revision cfg). +// Check warning for unexpected cfg in the code. // // check-pass -// revisions: empty_names_values empty_cfg feature full +// revisions: empty_cfg feature full // compile-flags: -Z unstable-options -// [empty_names_values]compile-flags: --check-cfg=names() --check-cfg=values() // [empty_cfg]compile-flags: --check-cfg=cfg() // [feature]compile-flags: --check-cfg=cfg(feature,values("std")) // [full]compile-flags: --check-cfg=cfg(feature,values("std")) --check-cfg=cfg() @@ -18,11 +16,15 @@ pub fn f() {} pub fn f() {} #[cfg(feature = "unk")] -//[feature]~^ WARNING unexpected `cfg` condition value -//[full]~^^ WARNING unexpected `cfg` condition value +//[empty_names_values]~^ WARNING unexpected `cfg` condition name +//[empty_cfg]~^^ WARNING unexpected `cfg` condition name +//[feature]~^^^ WARNING unexpected `cfg` condition value +//[full]~^^^^ WARNING unexpected `cfg` condition value pub fn feat() {} #[cfg(feature = "std")] +//[empty_names_values]~^ WARNING unexpected `cfg` condition name +//[empty_cfg]~^^ WARNING unexpected `cfg` condition name pub fn feat() {} #[cfg(windows)] diff --git a/tests/ui/check-cfg/exhaustive-names.empty_names.stderr b/tests/ui/check-cfg/exhaustive-names.empty_names.stderr deleted file mode 100644 index 6190ff714..000000000 --- a/tests/ui/check-cfg/exhaustive-names.empty_names.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names.rs:8:7 - | -LL | #[cfg(unknown_key = "value")] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `empty_names` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: 2 warnings emitted - diff --git a/tests/ui/check-cfg/exhaustive-names.exhaustive_names.stderr b/tests/ui/check-cfg/exhaustive-names.exhaustive_names.stderr deleted file mode 100644 index f338434cd..000000000 --- a/tests/ui/check-cfg/exhaustive-names.exhaustive_names.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning: unexpected `cfg` condition name: `unknown_key` - --> $DIR/exhaustive-names.rs:8:7 - | -LL | #[cfg(unknown_key = "value")] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `exhaustive_names` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: 2 warnings emitted - diff --git a/tests/ui/check-cfg/exhaustive-names.rs b/tests/ui/check-cfg/exhaustive-names.rs index b86a7f84e..806680206 100644 --- a/tests/ui/check-cfg/exhaustive-names.rs +++ b/tests/ui/check-cfg/exhaustive-names.rs @@ -1,9 +1,7 @@ // Check warning for unexpected cfg // // check-pass -// revisions: empty_names exhaustive_names -// [empty_names]compile-flags: --check-cfg=names() -Z unstable-options -// [exhaustive_names]compile-flags: --check-cfg=cfg() -Z unstable-options +// compile-flags: --check-cfg=cfg() -Z unstable-options #[cfg(unknown_key = "value")] //~^ WARNING unexpected `cfg` condition name diff --git a/tests/ui/check-cfg/exhaustive-names.stderr b/tests/ui/check-cfg/exhaustive-names.stderr new file mode 100644 index 000000000..cfac28cd9 --- /dev/null +++ b/tests/ui/check-cfg/exhaustive-names.stderr @@ -0,0 +1,13 @@ +warning: unexpected `cfg` condition name: `unknown_key` + --> $DIR/exhaustive-names.rs:6:7 + | +LL | #[cfg(unknown_key = "value")] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = 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` + = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr b/tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr index 999b27028..0a7bd81b8 100644 --- a/tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr +++ b/tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-values.rs:9:7 + --> $DIR/exhaustive-values.rs:8:7 | LL | #[cfg(test = "value")] | ^^^^---------- @@ -7,11 +7,9 @@ LL | #[cfg(test = "value")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default -warning: unexpected `empty_cfg` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: 2 warnings emitted +warning: 1 warning emitted diff --git a/tests/ui/check-cfg/exhaustive-values.empty_values.stderr b/tests/ui/check-cfg/exhaustive-values.empty_values.stderr deleted file mode 100644 index 77ddc3510..000000000 --- a/tests/ui/check-cfg/exhaustive-values.empty_values.stderr +++ /dev/null @@ -1,13 +0,0 @@ -warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-values.rs:9:7 - | -LL | #[cfg(test = "value")] - | ^^^^---------- - | | - | help: remove the value - | - = note: no expected value for `test` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/check-cfg/exhaustive-values.rs b/tests/ui/check-cfg/exhaustive-values.rs index 8a1689ba8..430d3b89e 100644 --- a/tests/ui/check-cfg/exhaustive-values.rs +++ b/tests/ui/check-cfg/exhaustive-values.rs @@ -1,8 +1,7 @@ // Check warning for unexpected cfg value // // check-pass -// revisions: empty_values empty_cfg without_names -// [empty_values]compile-flags: --check-cfg=values() -Z unstable-options +// revisions: empty_cfg without_names // [empty_cfg]compile-flags: --check-cfg=cfg() -Z unstable-options // [without_names]compile-flags: --check-cfg=cfg(any()) -Z unstable-options diff --git a/tests/ui/check-cfg/exhaustive-values.without_names.stderr b/tests/ui/check-cfg/exhaustive-values.without_names.stderr index 77ddc3510..0a7bd81b8 100644 --- a/tests/ui/check-cfg/exhaustive-values.without_names.stderr +++ b/tests/ui/check-cfg/exhaustive-values.without_names.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `value` - --> $DIR/exhaustive-values.rs:9:7 + --> $DIR/exhaustive-values.rs:8:7 | LL | #[cfg(test = "value")] | ^^^^---------- @@ -7,6 +7,8 @@ LL | #[cfg(test = "value")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("value"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted diff --git a/tests/ui/check-cfg/invalid-arguments.names_simple_ident.stderr b/tests/ui/check-cfg/invalid-arguments.names_simple_ident.stderr deleted file mode 100644 index 8fadcc1f9..000000000 --- a/tests/ui/check-cfg/invalid-arguments.names_simple_ident.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifiers) - diff --git a/tests/ui/check-cfg/invalid-arguments.rs b/tests/ui/check-cfg/invalid-arguments.rs index a56f48e0a..90c62fa38 100644 --- a/tests/ui/check-cfg/invalid-arguments.rs +++ b/tests/ui/check-cfg/invalid-arguments.rs @@ -1,7 +1,7 @@ // Check that invalid --check-cfg are rejected // // check-fail -// revisions: anything_else names_simple_ident values_simple_ident values_string_literals +// revisions: anything_else // revisions: string_for_name_1 string_for_name_2 multiple_any multiple_values // revisions: multiple_values_any not_empty_any not_empty_values_any // revisions: values_any_missing_values values_any_before_ident ident_in_values_1 @@ -10,9 +10,6 @@ // // compile-flags: -Z unstable-options // [anything_else]compile-flags: --check-cfg=anything_else(...) -// [names_simple_ident]compile-flags: --check-cfg=names("NOT_IDENT") -// [values_simple_ident]compile-flags: --check-cfg=values("NOT_IDENT") -// [values_string_literals]compile-flags: --check-cfg=values(test,12) // [string_for_name_1]compile-flags: --check-cfg=cfg("NOT_IDENT") // [string_for_name_2]compile-flags: --check-cfg=cfg(foo,"NOT_IDENT",bar) // [multiple_any]compile-flags: --check-cfg=cfg(any(),any()) diff --git a/tests/ui/check-cfg/invalid-arguments.values_simple_ident.stderr b/tests/ui/check-cfg/invalid-arguments.values_simple_ident.stderr deleted file mode 100644 index 061d3f0e9..000000000 --- a/tests/ui/check-cfg/invalid-arguments.values_simple_ident.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifier) - diff --git a/tests/ui/check-cfg/invalid-arguments.values_string_literals.stderr b/tests/ui/check-cfg/invalid-arguments.values_string_literals.stderr deleted file mode 100644 index 5853b4741..000000000 --- a/tests/ui/check-cfg/invalid-arguments.values_string_literals.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--check-cfg` argument: `values(test,12)` (`values()` arguments must be string literals) - diff --git a/tests/ui/check-cfg/mix.cfg.stderr b/tests/ui/check-cfg/mix.cfg.stderr deleted file mode 100644 index daa200440..000000000 --- a/tests/ui/check-cfg/mix.cfg.stderr +++ /dev/null @@ -1,192 +0,0 @@ -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/mix.rs:15:7 - | -LL | #[cfg(widnows)] - | ^^^^^^^ help: there is a config with a similar name: `windows` - | - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: (none) - --> $DIR/mix.rs:19:7 - | -LL | #[cfg(feature)] - | ^^^^^^^- help: specify a config value: `= "foo"` - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `bar` - --> $DIR/mix.rs:26:7 - | -LL | #[cfg(feature = "bar")] - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:30:7 - | -LL | #[cfg(feature = "zebra")] - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `uu` - --> $DIR/mix.rs:34:12 - | -LL | #[cfg_attr(uu, test)] - | ^^ - | - = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` - -warning: unexpected condition value `bar` for condition name `feature` - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected values - -warning: unexpected `unknown_name` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/mix.rs:43:10 - | -LL | cfg!(widnows); - | ^^^^^^^ help: there is a config with a similar name: `windows` - -warning: unexpected `cfg` condition value: `bar` - --> $DIR/mix.rs:46:10 - | -LL | cfg!(feature = "bar"); - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:48:10 - | -LL | cfg!(feature = "zebra"); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:50:10 - | -LL | cfg!(xxx = "foo"); - | ^^^^^^^^^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:52:10 - | -LL | cfg!(xxx); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:54:14 - | -LL | cfg!(any(xxx, windows)); - | ^^^ - -warning: unexpected `cfg` condition value: `bad` - --> $DIR/mix.rs:56:14 - | -LL | cfg!(any(feature = "bad", windows)); - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:58:23 - | -LL | cfg!(any(windows, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:60:20 - | -LL | cfg!(all(unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `aa` - --> $DIR/mix.rs:62:14 - | -LL | cfg!(all(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `bb` - --> $DIR/mix.rs:62:18 - | -LL | cfg!(all(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `aa` - --> $DIR/mix.rs:65:14 - | -LL | cfg!(any(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `bb` - --> $DIR/mix.rs:65:18 - | -LL | cfg!(any(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:68:20 - | -LL | cfg!(any(unix, feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:70:14 - | -LL | cfg!(any(xxx, feature = "zebra")); - | ^^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:70:19 - | -LL | cfg!(any(xxx, feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:73:14 - | -LL | cfg!(any(xxx, unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:73:25 - | -LL | cfg!(any(xxx, unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:14 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:33 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:52 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: 28 warnings emitted - diff --git a/tests/ui/check-cfg/mix.names_values.stderr b/tests/ui/check-cfg/mix.names_values.stderr deleted file mode 100644 index daa200440..000000000 --- a/tests/ui/check-cfg/mix.names_values.stderr +++ /dev/null @@ -1,192 +0,0 @@ -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/mix.rs:15:7 - | -LL | #[cfg(widnows)] - | ^^^^^^^ help: there is a config with a similar name: `windows` - | - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: (none) - --> $DIR/mix.rs:19:7 - | -LL | #[cfg(feature)] - | ^^^^^^^- help: specify a config value: `= "foo"` - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `bar` - --> $DIR/mix.rs:26:7 - | -LL | #[cfg(feature = "bar")] - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:30:7 - | -LL | #[cfg(feature = "zebra")] - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `uu` - --> $DIR/mix.rs:34:12 - | -LL | #[cfg_attr(uu, test)] - | ^^ - | - = help: expected names are: `cfg`, `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `names_values`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` - -warning: unexpected condition value `bar` for condition name `feature` - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected values - -warning: unexpected `unknown_name` as condition name - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected names - -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/mix.rs:43:10 - | -LL | cfg!(widnows); - | ^^^^^^^ help: there is a config with a similar name: `windows` - -warning: unexpected `cfg` condition value: `bar` - --> $DIR/mix.rs:46:10 - | -LL | cfg!(feature = "bar"); - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:48:10 - | -LL | cfg!(feature = "zebra"); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:50:10 - | -LL | cfg!(xxx = "foo"); - | ^^^^^^^^^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:52:10 - | -LL | cfg!(xxx); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:54:14 - | -LL | cfg!(any(xxx, windows)); - | ^^^ - -warning: unexpected `cfg` condition value: `bad` - --> $DIR/mix.rs:56:14 - | -LL | cfg!(any(feature = "bad", windows)); - | ^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:58:23 - | -LL | cfg!(any(windows, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:60:20 - | -LL | cfg!(all(unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `aa` - --> $DIR/mix.rs:62:14 - | -LL | cfg!(all(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `bb` - --> $DIR/mix.rs:62:18 - | -LL | cfg!(all(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `aa` - --> $DIR/mix.rs:65:14 - | -LL | cfg!(any(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition name: `bb` - --> $DIR/mix.rs:65:18 - | -LL | cfg!(any(aa, bb)); - | ^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:68:20 - | -LL | cfg!(any(unix, feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:70:14 - | -LL | cfg!(any(xxx, feature = "zebra")); - | ^^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:70:19 - | -LL | cfg!(any(xxx, feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:73:14 - | -LL | cfg!(any(xxx, unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition name: `xxx` - --> $DIR/mix.rs:73:25 - | -LL | cfg!(any(xxx, unix, xxx)); - | ^^^ - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:14 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:33 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: unexpected `cfg` condition value: `zebra` - --> $DIR/mix.rs:76:52 - | -LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); - | ^^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `foo` - -warning: 28 warnings emitted - diff --git a/tests/ui/check-cfg/mix.rs b/tests/ui/check-cfg/mix.rs index d7b3b4953..a6c3efee6 100644 --- a/tests/ui/check-cfg/mix.rs +++ b/tests/ui/check-cfg/mix.rs @@ -1,13 +1,10 @@ -// This test checks the combination of well known names, their activation via names(), -// the usage of values(), and that no implicit is done with --cfg while also testing that +// This test checks the combination of well known names, the usage of cfg(), +// and that no implicit cfgs is added from --cfg while also testing that // we correctly lint on the `cfg!` macro and `cfg_attr` attribute. // // check-pass -// revisions: names_values cfg // compile-flags: --cfg feature="bar" --cfg unknown_name -Z unstable-options -// compile-flags: --check-cfg=cfg(names_values,cfg) -// [names_values]compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") -// [cfg]compile-flags: --check-cfg=cfg(feature,values("foo")) +// compile-flags: --check-cfg=cfg(feature,values("foo")) #[cfg(windows)] fn do_windows_stuff() {} diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr new file mode 100644 index 000000000..39660a2fd --- /dev/null +++ b/tests/ui/check-cfg/mix.stderr @@ -0,0 +1,249 @@ +warning: unexpected `cfg` condition name: `widnows` + --> $DIR/mix.rs:12:7 + | +LL | #[cfg(widnows)] + | ^^^^^^^ help: there is a config with a similar name: `windows` + | + = help: to expect this configuration use `--check-cfg=cfg(widnows)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition value: (none) + --> $DIR/mix.rs:16:7 + | +LL | #[cfg(feature)] + | ^^^^^^^- help: specify a config value: `= "foo"` + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `bar` + --> $DIR/mix.rs:23:7 + | +LL | #[cfg(feature = "bar")] + | ^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("bar"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:27:7 + | +LL | #[cfg(feature = "zebra")] + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `uu` + --> $DIR/mix.rs:31:12 + | +LL | #[cfg_attr(uu, test)] + | ^^ + | + = 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` + = help: to expect this configuration use `--check-cfg=cfg(uu)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `widnows` + --> $DIR/mix.rs:40:10 + | +LL | cfg!(widnows); + | ^^^^^^^ help: there is a config with a similar name: `windows` + | + = help: to expect this configuration use `--check-cfg=cfg(widnows)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `bar` + --> $DIR/mix.rs:43:10 + | +LL | cfg!(feature = "bar"); + | ^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("bar"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:45:10 + | +LL | cfg!(feature = "zebra"); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:47:10 + | +LL | cfg!(xxx = "foo"); + | ^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:49:10 + | +LL | cfg!(xxx); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:51:14 + | +LL | cfg!(any(xxx, windows)); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `bad` + --> $DIR/mix.rs:53:14 + | +LL | cfg!(any(feature = "bad", windows)); + | ^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("bad"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:55:23 + | +LL | cfg!(any(windows, xxx)); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:57:20 + | +LL | cfg!(all(unix, xxx)); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `aa` + --> $DIR/mix.rs:59:14 + | +LL | cfg!(all(aa, bb)); + | ^^ + | + = help: to expect this configuration use `--check-cfg=cfg(aa)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `bb` + --> $DIR/mix.rs:59:18 + | +LL | cfg!(all(aa, bb)); + | ^^ + | + = help: to expect this configuration use `--check-cfg=cfg(bb)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `aa` + --> $DIR/mix.rs:62:14 + | +LL | cfg!(any(aa, bb)); + | ^^ + | + = help: to expect this configuration use `--check-cfg=cfg(aa)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `bb` + --> $DIR/mix.rs:62:18 + | +LL | cfg!(any(aa, bb)); + | ^^ + | + = help: to expect this configuration use `--check-cfg=cfg(bb)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:65:20 + | +LL | cfg!(any(unix, feature = "zebra")); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:67:14 + | +LL | cfg!(any(xxx, feature = "zebra")); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:67:19 + | +LL | cfg!(any(xxx, feature = "zebra")); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:70:14 + | +LL | cfg!(any(xxx, unix, xxx)); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `xxx` + --> $DIR/mix.rs:70:25 + | +LL | cfg!(any(xxx, unix, xxx)); + | ^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(xxx)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:73:14 + | +LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:73:33 + | +LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `zebra` + --> $DIR/mix.rs:73:52 + | +LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); + | ^^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `foo` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("zebra"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: 26 warnings emitted + diff --git a/tests/ui/check-cfg/no-expected-values.empty.stderr b/tests/ui/check-cfg/no-expected-values.empty.stderr index 5d261b2a5..ae55c95c0 100644 --- a/tests/ui/check-cfg/no-expected-values.empty.stderr +++ b/tests/ui/check-cfg/no-expected-values.empty.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:12:7 + --> $DIR/no-expected-values.rs:11:7 | LL | #[cfg(feature = "foo")] | ^^^^^^^-------- @@ -7,10 +7,12 @@ LL | #[cfg(feature = "foo")] | help: remove the value | = note: no expected value for `feature` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:16:7 + --> $DIR/no-expected-values.rs:15:7 | LL | #[cfg(test = "foo")] | ^^^^-------- @@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: 2 warnings emitted diff --git a/tests/ui/check-cfg/no-expected-values.mixed.stderr b/tests/ui/check-cfg/no-expected-values.mixed.stderr index 5d261b2a5..ae55c95c0 100644 --- a/tests/ui/check-cfg/no-expected-values.mixed.stderr +++ b/tests/ui/check-cfg/no-expected-values.mixed.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:12:7 + --> $DIR/no-expected-values.rs:11:7 | LL | #[cfg(feature = "foo")] | ^^^^^^^-------- @@ -7,10 +7,12 @@ LL | #[cfg(feature = "foo")] | help: remove the value | = note: no expected value for `feature` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:16:7 + --> $DIR/no-expected-values.rs:15:7 | LL | #[cfg(test = "foo")] | ^^^^-------- @@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: 2 warnings emitted diff --git a/tests/ui/check-cfg/no-expected-values.rs b/tests/ui/check-cfg/no-expected-values.rs index 9e2a9f09a..9f34c019e 100644 --- a/tests/ui/check-cfg/no-expected-values.rs +++ b/tests/ui/check-cfg/no-expected-values.rs @@ -1,10 +1,9 @@ // Check that we detect unexpected value when none are allowed // // check-pass -// revisions: values simple mixed empty +// revisions: simple mixed empty // compile-flags: -Z unstable-options // compile-flags: --check-cfg=cfg(values,simple,mixed,empty) -// [values]compile-flags: --check-cfg=values(test) --check-cfg=values(feature) // [simple]compile-flags: --check-cfg=cfg(test) --check-cfg=cfg(feature) // [mixed]compile-flags: --check-cfg=cfg(test,feature) // [empty]compile-flags: --check-cfg=cfg(test,feature,values()) diff --git a/tests/ui/check-cfg/no-expected-values.simple.stderr b/tests/ui/check-cfg/no-expected-values.simple.stderr index 5d261b2a5..ae55c95c0 100644 --- a/tests/ui/check-cfg/no-expected-values.simple.stderr +++ b/tests/ui/check-cfg/no-expected-values.simple.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:12:7 + --> $DIR/no-expected-values.rs:11:7 | LL | #[cfg(feature = "foo")] | ^^^^^^^-------- @@ -7,10 +7,12 @@ LL | #[cfg(feature = "foo")] | help: remove the value | = note: no expected value for `feature` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:16:7 + --> $DIR/no-expected-values.rs:15:7 | LL | #[cfg(test = "foo")] | ^^^^-------- @@ -18,6 +20,8 @@ LL | #[cfg(test = "foo")] | help: remove the value | = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: 2 warnings emitted diff --git a/tests/ui/check-cfg/no-expected-values.values.stderr b/tests/ui/check-cfg/no-expected-values.values.stderr deleted file mode 100644 index 5d261b2a5..000000000 --- a/tests/ui/check-cfg/no-expected-values.values.stderr +++ /dev/null @@ -1,23 +0,0 @@ -warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:12:7 - | -LL | #[cfg(feature = "foo")] - | ^^^^^^^-------- - | | - | help: remove the value - | - = note: no expected value for `feature` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `foo` - --> $DIR/no-expected-values.rs:16:7 - | -LL | #[cfg(test = "foo")] - | ^^^^-------- - | | - | help: remove the value - | - = note: no expected value for `test` - -warning: 2 warnings emitted - diff --git a/tests/ui/check-cfg/order-independant.names_after.stderr b/tests/ui/check-cfg/order-independant.names_after.stderr deleted file mode 100644 index a308358e4..000000000 --- a/tests/ui/check-cfg/order-independant.names_after.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: unexpected `cfg` condition value: (none) - --> $DIR/order-independant.rs:8:7 - | -LL | #[cfg(a)] - | ^- help: specify a config value: `= "b"` - | - = note: expected values for `a` are: `b` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `unk` - --> $DIR/order-independant.rs:12:7 - | -LL | #[cfg(a = "unk")] - | ^^^^^^^^^ - | - = note: expected values for `a` are: `b` - -warning: 2 warnings emitted - diff --git a/tests/ui/check-cfg/order-independant.names_before.stderr b/tests/ui/check-cfg/order-independant.names_before.stderr deleted file mode 100644 index a308358e4..000000000 --- a/tests/ui/check-cfg/order-independant.names_before.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: unexpected `cfg` condition value: (none) - --> $DIR/order-independant.rs:8:7 - | -LL | #[cfg(a)] - | ^- help: specify a config value: `= "b"` - | - = note: expected values for `a` are: `b` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `unk` - --> $DIR/order-independant.rs:12:7 - | -LL | #[cfg(a = "unk")] - | ^^^^^^^^^ - | - = note: expected values for `a` are: `b` - -warning: 2 warnings emitted - diff --git a/tests/ui/check-cfg/order-independant.rs b/tests/ui/check-cfg/order-independant.rs index ce056b8dc..86e3cfa1d 100644 --- a/tests/ui/check-cfg/order-independant.rs +++ b/tests/ui/check-cfg/order-independant.rs @@ -1,12 +1,13 @@ // check-pass -// revisions: names_before names_after +// +// revisions: values_before values_after // compile-flags: -Z unstable-options -// compile-flags: --check-cfg=names(names_before,names_after) -// [names_before]compile-flags: --check-cfg=names(a) --check-cfg=values(a,"b") -// [names_after]compile-flags: --check-cfg=values(a,"b") --check-cfg=names(a) +// compile-flags: --check-cfg=cfg(values_before,values_after) +// +// [values_before]compile-flags: --check-cfg=cfg(a,values("b")) --check-cfg=cfg(a) +// [values_after]compile-flags: --check-cfg=cfg(a) --check-cfg=cfg(a,values("b")) #[cfg(a)] -//~^ WARNING unexpected `cfg` condition value fn my_cfg() {} #[cfg(a = "unk")] diff --git a/tests/ui/check-cfg/order-independant.values_after.stderr b/tests/ui/check-cfg/order-independant.values_after.stderr new file mode 100644 index 000000000..d1de26ba3 --- /dev/null +++ b/tests/ui/check-cfg/order-independant.values_after.stderr @@ -0,0 +1,13 @@ +warning: unexpected `cfg` condition value: `unk` + --> $DIR/order-independant.rs:13:7 + | +LL | #[cfg(a = "unk")] + | ^^^^^^^^^ + | + = note: expected values for `a` are: (none), `b` + = help: to expect this configuration use `--check-cfg=cfg(a, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/order-independant.values_before.stderr b/tests/ui/check-cfg/order-independant.values_before.stderr new file mode 100644 index 000000000..d1de26ba3 --- /dev/null +++ b/tests/ui/check-cfg/order-independant.values_before.stderr @@ -0,0 +1,13 @@ +warning: unexpected `cfg` condition value: `unk` + --> $DIR/order-independant.rs:13:7 + | +LL | #[cfg(a = "unk")] + | ^^^^^^^^^ + | + = note: expected values for `a` are: (none), `b` + = help: to expect this configuration use `--check-cfg=cfg(a, values("unk"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/stmt-no-ice.stderr b/tests/ui/check-cfg/stmt-no-ice.stderr index 900ea4e4d..112367606 100644 --- a/tests/ui/check-cfg/stmt-no-ice.stderr +++ b/tests/ui/check-cfg/stmt-no-ice.stderr @@ -4,7 +4,9 @@ warning: unexpected `cfg` condition name: `crossbeam_loom` LL | #[cfg(crossbeam_loom)] | ^^^^^^^^^^^^^^ | - = help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(crossbeam_loom)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default warning: 1 warning emitted diff --git a/tests/ui/check-cfg/unexpected-cfg-name.exhaustive.stderr b/tests/ui/check-cfg/unexpected-cfg-name.exhaustive.stderr deleted file mode 100644 index 513f7ac7f..000000000 --- a/tests/ui/check-cfg/unexpected-cfg-name.exhaustive.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/unexpected-cfg-name.rs:9:7 - | -LL | #[cfg(widnows)] - | ^^^^^^^ help: there is a config with a similar name: `windows` - | - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/check-cfg/unexpected-cfg-name.names.stderr b/tests/ui/check-cfg/unexpected-cfg-name.names.stderr deleted file mode 100644 index 513f7ac7f..000000000 --- a/tests/ui/check-cfg/unexpected-cfg-name.names.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: unexpected `cfg` condition name: `widnows` - --> $DIR/unexpected-cfg-name.rs:9:7 - | -LL | #[cfg(widnows)] - | ^^^^^^^ help: there is a config with a similar name: `windows` - | - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/check-cfg/unexpected-cfg-name.rs b/tests/ui/check-cfg/unexpected-cfg-name.rs index 15c3aa6e0..9fc0e28a8 100644 --- a/tests/ui/check-cfg/unexpected-cfg-name.rs +++ b/tests/ui/check-cfg/unexpected-cfg-name.rs @@ -1,10 +1,7 @@ // Check warning for unexpected configuration name // // check-pass -// revisions: names exhaustive -// compile-flags: --check-cfg=cfg(names,exhaustive) -// [names]compile-flags: --check-cfg=names() -Z unstable-options -// [exhaustive]compile-flags: --check-cfg=cfg() -Z unstable-options +// compile-flags: --check-cfg=cfg() -Z unstable-options #[cfg(widnows)] //~^ WARNING unexpected `cfg` condition name diff --git a/tests/ui/check-cfg/unexpected-cfg-name.stderr b/tests/ui/check-cfg/unexpected-cfg-name.stderr new file mode 100644 index 000000000..8748b324f --- /dev/null +++ b/tests/ui/check-cfg/unexpected-cfg-name.stderr @@ -0,0 +1,12 @@ +warning: unexpected `cfg` condition name: `widnows` + --> $DIR/unexpected-cfg-name.rs:6:7 + | +LL | #[cfg(widnows)] + | ^^^^^^^ help: there is a config with a similar name: `windows` + | + = help: to expect this configuration use `--check-cfg=cfg(widnows)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/check-cfg/unexpected-cfg-value.cfg.stderr b/tests/ui/check-cfg/unexpected-cfg-value.cfg.stderr deleted file mode 100644 index 2ed7f9005..000000000 --- a/tests/ui/check-cfg/unexpected-cfg-value.cfg.stderr +++ /dev/null @@ -1,25 +0,0 @@ -warning: unexpected `cfg` condition value: `sedre` - --> $DIR/unexpected-cfg-value.rs:11:7 - | -LL | #[cfg(feature = "sedre")] - | ^^^^^^^^^^------- - | | - | help: there is a expected value with a similar name: `"serde"` - | - = note: expected values for `feature` are: `full`, `serde` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `rand` - --> $DIR/unexpected-cfg-value.rs:18:7 - | -LL | #[cfg(feature = "rand")] - | ^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `full`, `serde` - -warning: unexpected condition value `rand` for condition name `feature` - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected values - -warning: 3 warnings emitted - diff --git a/tests/ui/check-cfg/unexpected-cfg-value.rs b/tests/ui/check-cfg/unexpected-cfg-value.rs index a84458071..54dce0f0d 100644 --- a/tests/ui/check-cfg/unexpected-cfg-value.rs +++ b/tests/ui/check-cfg/unexpected-cfg-value.rs @@ -1,12 +1,8 @@ -// Check warning for invalid configuration value in the code and -// in the cli +// Check for unexpected configuration value in the code. // // check-pass -// revisions: values cfg // compile-flags: --cfg=feature="rand" -Z unstable-options -// compile-flags: --check-cfg=cfg(values,cfg) -// [values]compile-flags: --check-cfg=values(feature,"serde","full") -// [cfg]compile-flags: --check-cfg=cfg(feature,values("serde","full")) +// compile-flags: --check-cfg=cfg(feature,values("serde","full")) #[cfg(feature = "sedre")] //~^ WARNING unexpected `cfg` condition value diff --git a/tests/ui/check-cfg/unexpected-cfg-value.stderr b/tests/ui/check-cfg/unexpected-cfg-value.stderr new file mode 100644 index 000000000..e5435d376 --- /dev/null +++ b/tests/ui/check-cfg/unexpected-cfg-value.stderr @@ -0,0 +1,25 @@ +warning: unexpected `cfg` condition value: `sedre` + --> $DIR/unexpected-cfg-value.rs:7:7 + | +LL | #[cfg(feature = "sedre")] + | ^^^^^^^^^^------- + | | + | help: there is a expected value with a similar name: `"serde"` + | + = note: expected values for `feature` are: `full`, `serde` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("sedre"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + = note: `#[warn(unexpected_cfgs)]` on by default + +warning: unexpected `cfg` condition value: `rand` + --> $DIR/unexpected-cfg-value.rs:14:7 + | +LL | #[cfg(feature = "rand")] + | ^^^^^^^^^^^^^^^^ + | + = note: expected values for `feature` are: `full`, `serde` + = help: to expect this configuration use `--check-cfg=cfg(feature, values("rand"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: 2 warnings emitted + diff --git a/tests/ui/check-cfg/unexpected-cfg-value.values.stderr b/tests/ui/check-cfg/unexpected-cfg-value.values.stderr deleted file mode 100644 index 2ed7f9005..000000000 --- a/tests/ui/check-cfg/unexpected-cfg-value.values.stderr +++ /dev/null @@ -1,25 +0,0 @@ -warning: unexpected `cfg` condition value: `sedre` - --> $DIR/unexpected-cfg-value.rs:11:7 - | -LL | #[cfg(feature = "sedre")] - | ^^^^^^^^^^------- - | | - | help: there is a expected value with a similar name: `"serde"` - | - = note: expected values for `feature` are: `full`, `serde` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: unexpected `cfg` condition value: `rand` - --> $DIR/unexpected-cfg-value.rs:18:7 - | -LL | #[cfg(feature = "rand")] - | ^^^^^^^^^^^^^^^^ - | - = note: expected values for `feature` are: `full`, `serde` - -warning: unexpected condition value `rand` for condition name `feature` - | - = help: was set with `--cfg` but isn't in the `--check-cfg` expected values - -warning: 3 warnings emitted - diff --git a/tests/ui/check-cfg/values-target-json.rs b/tests/ui/check-cfg/values-target-json.rs index 2ef5a4459..47ac79e0d 100644 --- a/tests/ui/check-cfg/values-target-json.rs +++ b/tests/ui/check-cfg/values-target-json.rs @@ -2,7 +2,7 @@ // // check-pass // needs-llvm-components: x86 -// compile-flags: --crate-type=lib --check-cfg=values() --target={{src-base}}/check-cfg/my-awesome-platform.json -Z unstable-options +// compile-flags: --crate-type=lib --check-cfg=cfg() --target={{src-base}}/check-cfg/my-awesome-platform.json -Z unstable-options #![feature(lang_items, no_core, auto_traits)] #![no_core] @@ -10,10 +10,6 @@ #[lang = "sized"] trait Sized {} -#[cfg(target_os = "linuz")] -//~^ WARNING unexpected `cfg` condition value -fn target_os_linux_misspell() {} - #[cfg(target_os = "linux")] fn target_os_linux() {} diff --git a/tests/ui/check-cfg/values-target-json.stderr b/tests/ui/check-cfg/values-target-json.stderr deleted file mode 100644 index e71149f33..000000000 --- a/tests/ui/check-cfg/values-target-json.stderr +++ /dev/null @@ -1,13 +0,0 @@ -warning: unexpected `cfg` condition value: `linuz` - --> $DIR/values-target-json.rs:13:7 - | -LL | #[cfg(target_os = "linuz")] - | ^^^^^^^^^^^^------- - | | - | help: there is a expected value with a similar name: `"linux"` - | - = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `ericos`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous` - = note: `#[warn(unexpected_cfgs)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/check-cfg/well-known-names.rs b/tests/ui/check-cfg/well-known-names.rs index 1dcb419b4..32c14703d 100644 --- a/tests/ui/check-cfg/well-known-names.rs +++ b/tests/ui/check-cfg/well-known-names.rs @@ -15,6 +15,7 @@ fn target_os() {} fn feature_misspell() {} #[cfg(feature = "foo")] +//~^ WARNING unexpected `cfg` condition name fn feature() {} #[cfg(uniw)] diff --git a/tests/ui/check-cfg/well-known-names.stderr b/tests/ui/check-cfg/well-known-names.stderr index 3001289b7..763ba4646 100644 --- a/tests/ui/check-cfg/well-known-names.stderr +++ b/tests/ui/check-cfg/well-known-names.stderr @@ -4,6 +4,8 @@ warning: unexpected `cfg` condition name: `target_oz` LL | #[cfg(target_oz = "linux")] | ^^^^^^^^^^^^^^^^^^^ | + = help: to expect this configuration use `--check-cfg=cfg(target_oz, values("linux"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default help: there is a config with a similar name and value | @@ -14,15 +16,29 @@ warning: unexpected `cfg` condition name: `features` --> $DIR/well-known-names.rs:13:7 | LL | #[cfg(features = "foo")] - | --------^^^^^^^^ - | | - | help: there is a config with a similar name: `feature` + | ^^^^^^^^^^^^^^^^ + | + = 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` + = help: to expect this configuration use `--check-cfg=cfg(features, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition name: `feature` + --> $DIR/well-known-names.rs:17:7 + | +LL | #[cfg(feature = "foo")] + | ^^^^^^^^^^^^^^^ + | + = help: to expect this configuration use `--check-cfg=cfg(feature, values("foo"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition name: `uniw` - --> $DIR/well-known-names.rs:20:7 + --> $DIR/well-known-names.rs:21:7 | LL | #[cfg(uniw)] | ^^^^ help: there is a config with a similar name: `unix` + | + = help: to expect this configuration use `--check-cfg=cfg(uniw)` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: 3 warnings emitted +warning: 4 warnings emitted diff --git a/tests/ui/check-cfg/well-known-values.rs b/tests/ui/check-cfg/well-known-values.rs index 8b56c8729..21268bf10 100644 --- a/tests/ui/check-cfg/well-known-values.rs +++ b/tests/ui/check-cfg/well-known-values.rs @@ -1,41 +1,108 @@ -// This test check that we lint on non well known values and that we don't lint on well known -// values +// This test check that we recognize all the well known config names +// and that we correctly lint on unexpected values. +// +// This test also serve as an "anti-regression" for the well known +// values since the suggestion shows them. // // check-pass // compile-flags: --check-cfg=cfg() -Z unstable-options -#[cfg(target_os = "linuz")] +#![feature(cfg_overflow_checks)] +#![feature(cfg_relocation_model)] +#![feature(cfg_sanitize)] +#![feature(cfg_target_abi)] +#![feature(cfg_target_has_atomic)] +#![feature(cfg_target_has_atomic_equal_alignment)] +#![feature(cfg_target_thread_local)] + +// This part makes sure that none of the well known names are +// unexpected. +// +// BUT to make sure that no expected values changes without +// being noticed we pass them a obviously wrong value so the +// diagnostic prints the list of expected values. +#[cfg(any( + // tidy-alphabetical-start + debug_assertions = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + doc = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + doctest = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + miri = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + overflow_checks = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + panic = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + proc_macro = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + relocation_model = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + sanitize = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_abi = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_arch = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_endian = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_env = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_family = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_feature = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_has_atomic = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_has_atomic_load_store = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_os = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_pointer_width = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_thread_local = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + target_vendor = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + test = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + unix = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + windows = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value + // tidy-alphabetical-end +))] +fn unexpected_values() {} + +#[cfg(target_os = "linuz")] // testing that we suggest `linux` //~^ WARNING unexpected `cfg` condition value fn target_os_linux_misspell() {} +// The #[cfg]s below serve as a safeguard to make sure we +// don't lint when using an expected well-known name and +// value, only a small subset of all possible expected +// configs are tested, since we already test the names +// above and don't need to test all values, just different +// combinations (without value, with value, both...). + #[cfg(target_os = "linux")] fn target_os_linux() {} -#[cfg(target_has_atomic = "0")] -//~^ WARNING unexpected `cfg` condition value -fn target_has_atomic_invalid() {} +#[cfg(target_feature = "crt-static")] // pure rustc feature +fn target_feature() {} #[cfg(target_has_atomic = "8")] -fn target_has_atomic() {} +fn target_has_atomic_8() {} -#[cfg(unix = "aa")] -//~^ WARNING unexpected `cfg` condition value -fn unix_with_value() {} +#[cfg(target_has_atomic)] +fn target_has_atomic() {} #[cfg(unix)] fn unix() {} -#[cfg(miri = "miri")] -//~^ WARNING unexpected `cfg` condition value -fn miri_with_value() {} - -#[cfg(miri)] -fn miri() {} - -#[cfg(doc = "linux")] -//~^ WARNING unexpected `cfg` condition value -fn doc_with_value() {} - #[cfg(doc)] fn doc() {} diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr index 6877d8f5b..4f708e62c 100644 --- a/tests/ui/check-cfg/well-known-values.stderr +++ b/tests/ui/check-cfg/well-known-values.stderr @@ -1,53 +1,285 @@ -warning: unexpected `cfg` condition value: `linuz` - --> $DIR/well-known-values.rs:7:7 +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:26:5 | -LL | #[cfg(target_os = "linuz")] - | ^^^^^^^^^^^^------- - | | - | help: there is a expected value with a similar name: `"linux"` +LL | debug_assertions = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^---------------------- + | | + | help: remove the value | - = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous` + = note: no expected value for `debug_assertions` + = help: to expect this configuration use `--check-cfg=cfg(debug_assertions, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default -warning: unexpected `cfg` condition value: `0` - --> $DIR/well-known-values.rs:14:7 +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:28:5 + | +LL | doc = "_UNEXPECTED_VALUE", + | ^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `doc` + = help: to expect this configuration use `--check-cfg=cfg(doc, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:30:5 + | +LL | doctest = "_UNEXPECTED_VALUE", + | ^^^^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `doctest` + = help: to expect this configuration use `--check-cfg=cfg(doctest, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:32:5 + | +LL | miri = "_UNEXPECTED_VALUE", + | ^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `miri` + = help: to expect this configuration use `--check-cfg=cfg(miri, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:34:5 + | +LL | overflow_checks = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `overflow_checks` + = help: to expect this configuration use `--check-cfg=cfg(overflow_checks, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:36:5 + | +LL | panic = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `panic` are: `abort`, `unwind` + = help: to expect this configuration use `--check-cfg=cfg(panic, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:38:5 + | +LL | proc_macro = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `proc_macro` + = help: to expect this configuration use `--check-cfg=cfg(proc_macro, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:40:5 + | +LL | relocation_model = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `relocation_model` are: `dynamic-no-pic`, `pic`, `pie`, `ropi`, `ropi-rwpi`, `rwpi`, `static` + = help: to expect this configuration use `--check-cfg=cfg(relocation_model, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:42:5 + | +LL | sanitize = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `sanitize` are: `address`, `cfi`, `hwaddress`, `kcfi`, `kernel-address`, `leak`, `memory`, `memtag`, `safestack`, `shadow-call-stack`, `thread` + = help: to expect this configuration use `--check-cfg=cfg(sanitize, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:44:5 + | +LL | target_abi = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_abi` are: ``, `abi64`, `abiv2`, `abiv2hf`, `eabi`, `eabihf`, `elf`, `fortanix`, `ilp32`, `llvm`, `macabi`, `sim`, `softfloat`, `spe`, `uwp`, `vec-extabi`, `x32` + = help: to expect this configuration use `--check-cfg=cfg(target_abi, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:46:5 + | +LL | target_arch = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = 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` + = help: to expect this configuration use `--check-cfg=cfg(target_arch, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:48:5 + | +LL | target_endian = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_endian` are: `big`, `little` + = help: to expect this configuration use `--check-cfg=cfg(target_endian, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:50:5 + | +LL | target_env = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_env` are: ``, `eabihf`, `gnu`, `gnueabihf`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc` + = help: to expect this configuration use `--check-cfg=cfg(target_env, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:52:5 + | +LL | target_family = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_family` are: `unix`, `wasm`, `windows` + = help: to expect this configuration use `--check-cfg=cfg(target_family, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:54:5 + | +LL | target_feature = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512er`, `avx512f`, `avx512ifma`, `avx512pf`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `f`, `f16c`, `f32mm`, `f64mm`, `fast-unaligned-access`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sign-ext`, `simd128`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt` + = help: to expect this configuration use `--check-cfg=cfg(target_feature, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:56:5 | -LL | #[cfg(target_has_atomic = "0")] - | ^^^^^^^^^^^^^^^^^^^^--- - | | - | help: there is a expected value with a similar name: `"8"` +LL | target_has_atomic = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected values for `target_has_atomic` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr` + = help: to expect this configuration use `--check-cfg=cfg(target_has_atomic, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:58:5 + | +LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_has_atomic_equal_alignment` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr` + = help: to expect this configuration use `--check-cfg=cfg(target_has_atomic_equal_alignment, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:60:5 + | +LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_has_atomic_load_store` are: (none), `128`, `16`, `32`, `64`, `8`, `ptr` + = help: to expect this configuration use `--check-cfg=cfg(target_has_atomic_load_store, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:62:5 + | +LL | target_os = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = 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` + = help: to expect this configuration use `--check-cfg=cfg(target_os, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `cfg` condition value: `aa` - --> $DIR/well-known-values.rs:21:7 +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:64:5 | -LL | #[cfg(unix = "aa")] - | ^^^^------- - | | - | help: remove the value +LL | target_pointer_width = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_pointer_width` are: `16`, `32`, `64` + = help: to expect this configuration use `--check-cfg=cfg(target_pointer_width, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:66:5 + | +LL | target_thread_local = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `target_thread_local` + = help: to expect this configuration use `--check-cfg=cfg(target_thread_local, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:68:5 + | +LL | target_vendor = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, `wrs` + = help: to expect this configuration use `--check-cfg=cfg(target_vendor, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:70:5 + | +LL | test = "_UNEXPECTED_VALUE", + | ^^^^---------------------- + | | + | help: remove the value + | + = note: no expected value for `test` + = help: to expect this configuration use `--check-cfg=cfg(test, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration + +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:72:5 + | +LL | unix = "_UNEXPECTED_VALUE", + | ^^^^---------------------- + | | + | help: remove the value | = note: no expected value for `unix` + = help: to expect this configuration use `--check-cfg=cfg(unix, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `cfg` condition value: `miri` - --> $DIR/well-known-values.rs:28:7 +warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` + --> $DIR/well-known-values.rs:74:5 | -LL | #[cfg(miri = "miri")] - | ^^^^--------- - | | - | help: remove the value +LL | windows = "_UNEXPECTED_VALUE", + | ^^^^^^^---------------------- + | | + | help: remove the value | - = note: no expected value for `miri` + = note: no expected value for `windows` + = help: to expect this configuration use `--check-cfg=cfg(windows, values("_UNEXPECTED_VALUE"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: unexpected `cfg` condition value: `linux` - --> $DIR/well-known-values.rs:35:7 +warning: unexpected `cfg` condition value: `linuz` + --> $DIR/well-known-values.rs:80:7 | -LL | #[cfg(doc = "linux")] - | ^^^---------- - | | - | help: remove the value +LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux` + | ^^^^^^^^^^^^------- + | | + | help: there is a expected value with a similar name: `"linux"` | - = note: no expected value for `doc` + = 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` + = help: to expect this configuration use `--check-cfg=cfg(target_os, values("linuz"))` + = note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration -warning: 5 warnings emitted +warning: 26 warnings emitted |