diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
commit | 2ff14448863ac1a1dd9533461708e29aae170c2d (patch) | |
tree | 85b9fea2bbfe3f06473cfa381eed11f273b57c5c /src/test/ui/check-cfg | |
parent | Adding debian version 1.64.0+dfsg1-1. (diff) | |
download | rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip |
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/check-cfg/allow-at-crate-level.rs | 8 | ||||
-rw-r--r-- | src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr | 2 | ||||
-rw-r--r-- | src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr | 2 | ||||
-rw-r--r-- | src/test/ui/check-cfg/invalid-cfg-value.stderr | 6 | ||||
-rw-r--r-- | src/test/ui/check-cfg/mix.rs | 2 | ||||
-rw-r--r-- | src/test/ui/check-cfg/mix.stderr | 10 |
6 files changed, 25 insertions, 5 deletions
diff --git a/src/test/ui/check-cfg/allow-at-crate-level.rs b/src/test/ui/check-cfg/allow-at-crate-level.rs new file mode 100644 index 000000000..ce3383a29 --- /dev/null +++ b/src/test/ui/check-cfg/allow-at-crate-level.rs @@ -0,0 +1,8 @@ +// This test check that #![allow(unexpected_cfgs)] works with --cfg +// +// check-pass +// compile-flags: --cfg=unexpected --check-cfg=names() -Z unstable-options + +#![allow(unexpected_cfgs)] + +fn main() {} diff --git a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr index bdfbc3d54..8fadcc1f9 100644 --- a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr +++ b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr @@ -1,2 +1,2 @@ -error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifers) +error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifiers) diff --git a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr index b25882baa..061d3f0e9 100644 --- a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr +++ b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr @@ -1,2 +1,2 @@ -error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifer) +error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifier) diff --git a/src/test/ui/check-cfg/invalid-cfg-value.stderr b/src/test/ui/check-cfg/invalid-cfg-value.stderr index 6cce31d33..7db2aadec 100644 --- a/src/test/ui/check-cfg/invalid-cfg-value.stderr +++ b/src/test/ui/check-cfg/invalid-cfg-value.stderr @@ -15,5 +15,9 @@ LL | #[cfg(feature = "rand")] | = note: expected values for `feature` are: full, serde -warning: 2 warnings emitted +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/src/test/ui/check-cfg/mix.rs b/src/test/ui/check-cfg/mix.rs index 8e3d20d50..4e488fc03 100644 --- a/src/test/ui/check-cfg/mix.rs +++ b/src/test/ui/check-cfg/mix.rs @@ -3,7 +3,7 @@ // we correctly lint on the `cfg!` macro and `cfg_attr` attribute. // // check-pass -// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" -Z unstable-options +// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" --cfg unknown_name -Z unstable-options #[cfg(windows)] fn do_windows_stuff() {} diff --git a/src/test/ui/check-cfg/mix.stderr b/src/test/ui/check-cfg/mix.stderr index e51b75b3d..9cf887ec7 100644 --- a/src/test/ui/check-cfg/mix.stderr +++ b/src/test/ui/check-cfg/mix.stderr @@ -28,6 +28,14 @@ warning: unexpected `cfg` condition name 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 + +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 --> $DIR/mix.rs:35:10 | @@ -170,5 +178,5 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra")); | = note: expected values for `feature` are: foo -warning: 25 warnings emitted +warning: 27 warnings emitted |