Skip to content

Commit

Permalink
Update --check-cfg tests that had old --cfg warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Nov 2, 2023
1 parent 586f8d4 commit 21109fb
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 117 deletions.
10 changes: 3 additions & 7 deletions tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: unexpected `cfg` condition name: `unknown_key`
--> $DIR/exhaustive-names-values.rs:12:7
--> $DIR/exhaustive-names-values.rs:11:7
|
LL | #[cfg(unknown_key = "value")]
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[cfg(unknown_key = "value")]
= 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:15:7
|
LL | #[cfg(test = "value")]
| ^^^^----------
Expand All @@ -17,9 +17,5 @@ LL | #[cfg(test = "value")]
|
= note: no expected value for `test`

warning: unexpected `empty_cfg` as condition name
|
= help: was set with `--cfg` but isn't in the `--check-cfg` expected names

warning: 3 warnings emitted
warning: 2 warnings emitted

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: unexpected `cfg` condition name: `unknown_key`
--> $DIR/exhaustive-names-values.rs:12:7
--> $DIR/exhaustive-names-values.rs:11:7
|
LL | #[cfg(unknown_key = "value")]
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[cfg(unknown_key = "value")]
= 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:15:7
|
LL | #[cfg(test = "value")]
| ^^^^----------
Expand All @@ -17,9 +17,5 @@ LL | #[cfg(test = "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
warning: 2 warnings emitted

12 changes: 4 additions & 8 deletions tests/ui/check-cfg/exhaustive-names-values.feature.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: unexpected `cfg` condition name: `unknown_key`
--> $DIR/exhaustive-names-values.rs:12:7
--> $DIR/exhaustive-names-values.rs:11:7
|
LL | #[cfg(unknown_key = "value")]
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[cfg(unknown_key = "value")]
= 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:15:7
|
LL | #[cfg(test = "value")]
| ^^^^----------
Expand All @@ -18,16 +18,12 @@ LL | #[cfg(test = "value")]
= note: no expected value for `test`

warning: unexpected `cfg` condition value: `unk`
--> $DIR/exhaustive-names-values.rs:20:7
--> $DIR/exhaustive-names-values.rs:19:7
|
LL | #[cfg(feature = "unk")]
| ^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `std`

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

12 changes: 4 additions & 8 deletions tests/ui/check-cfg/exhaustive-names-values.full.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: unexpected `cfg` condition name: `unknown_key`
--> $DIR/exhaustive-names-values.rs:12:7
--> $DIR/exhaustive-names-values.rs:11:7
|
LL | #[cfg(unknown_key = "value")]
| ^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[cfg(unknown_key = "value")]
= 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:15:7
|
LL | #[cfg(test = "value")]
| ^^^^----------
Expand All @@ -18,16 +18,12 @@ LL | #[cfg(test = "value")]
= note: no expected value for `test`

warning: unexpected `cfg` condition value: `unk`
--> $DIR/exhaustive-names-values.rs:20:7
--> $DIR/exhaustive-names-values.rs:19:7
|
LL | #[cfg(feature = "unk")]
| ^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `std`

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

3 changes: 1 addition & 2 deletions tests/ui/check-cfg/exhaustive-names-values.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 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
Expand Down
6 changes: 1 addition & 5 deletions tests/ui/check-cfg/exhaustive-names.empty_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ 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
warning: 1 warning emitted

6 changes: 1 addition & 5 deletions tests/ui/check-cfg/exhaustive-names.exhaustive_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ 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
warning: 1 warning emitted

6 changes: 1 addition & 5 deletions tests/ui/check-cfg/exhaustive-values.empty_cfg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ LL | #[cfg(test = "value")]
= note: no expected value for `test`
= 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

57 changes: 31 additions & 26 deletions tests/ui/check-cfg/mix.cfg.stderr
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
warning: unexpected `cfg` condition name: `widnows`
--> $DIR/mix.rs:15:7
--> $DIR/mix.rs:17: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
--> $DIR/mix.rs:21: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
--> $DIR/mix.rs:28:7
|
LL | #[cfg(feature = "bar")]
| ^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `zebra`
--> $DIR/mix.rs:30:7
--> $DIR/mix.rs:32:7
|
LL | #[cfg(feature = "zebra")]
| ^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `uu`
--> $DIR/mix.rs:34:12
--> $DIR/mix.rs:36:12
|
LL | #[cfg_attr(uu, test)]
| ^^
Expand All @@ -41,147 +41,152 @@ LL | #[cfg_attr(uu, test)]
warning: unexpected condition value `bar` for condition name `feature`
|
= help: was set with `--cfg` but isn't in the `--check-cfg` expected values
note: the lint level is defined here
--> $DIR/mix.rs:12:9
|
LL | #![warn(unexpected_cli_cfgs)]
| ^^^^^^^^^^^^^^^^^^^

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
--> $DIR/mix.rs:45: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
--> $DIR/mix.rs:48:10
|
LL | cfg!(feature = "bar");
| ^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition value: `zebra`
--> $DIR/mix.rs:48:10
--> $DIR/mix.rs:50:10
|
LL | cfg!(feature = "zebra");
| ^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `foo`

warning: unexpected `cfg` condition name: `xxx`
--> $DIR/mix.rs:50:10
--> $DIR/mix.rs:52:10
|
LL | cfg!(xxx = "foo");
| ^^^^^^^^^^^

warning: unexpected `cfg` condition name: `xxx`
--> $DIR/mix.rs:52:10
--> $DIR/mix.rs:54:10
|
LL | cfg!(xxx);
| ^^^

warning: unexpected `cfg` condition name: `xxx`
--> $DIR/mix.rs:54:14
--> $DIR/mix.rs:56:14
|
LL | cfg!(any(xxx, windows));
| ^^^

warning: unexpected `cfg` condition value: `bad`
--> $DIR/mix.rs:56:14
--> $DIR/mix.rs:58: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
--> $DIR/mix.rs:60:23
|
LL | cfg!(any(windows, xxx));
| ^^^

warning: unexpected `cfg` condition name: `xxx`
--> $DIR/mix.rs:60:20
--> $DIR/mix.rs:62:20
|
LL | cfg!(all(unix, xxx));
| ^^^

warning: unexpected `cfg` condition name: `aa`
--> $DIR/mix.rs:62:14
--> $DIR/mix.rs:64:14
|
LL | cfg!(all(aa, bb));
| ^^

warning: unexpected `cfg` condition name: `bb`
--> $DIR/mix.rs:62:18
--> $DIR/mix.rs:64:18
|
LL | cfg!(all(aa, bb));
| ^^

warning: unexpected `cfg` condition name: `aa`
--> $DIR/mix.rs:65:14
--> $DIR/mix.rs:67:14
|
LL | cfg!(any(aa, bb));
| ^^

warning: unexpected `cfg` condition name: `bb`
--> $DIR/mix.rs:65:18
--> $DIR/mix.rs:67:18
|
LL | cfg!(any(aa, bb));
| ^^

warning: unexpected `cfg` condition value: `zebra`
--> $DIR/mix.rs:68:20
--> $DIR/mix.rs:70: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
--> $DIR/mix.rs:72:14
|
LL | cfg!(any(xxx, feature = "zebra"));
| ^^^

warning: unexpected `cfg` condition value: `zebra`
--> $DIR/mix.rs:70:19
--> $DIR/mix.rs:72: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
--> $DIR/mix.rs:75:14
|
LL | cfg!(any(xxx, unix, xxx));
| ^^^

warning: unexpected `cfg` condition name: `xxx`
--> $DIR/mix.rs:73:25
--> $DIR/mix.rs:75:25
|
LL | cfg!(any(xxx, unix, xxx));
| ^^^

warning: unexpected `cfg` condition value: `zebra`
--> $DIR/mix.rs:76:14
--> $DIR/mix.rs:78: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
--> $DIR/mix.rs:78: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
--> $DIR/mix.rs:78:52
|
LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
| ^^^^^^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit 21109fb

Please sign in to comment.