summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-10-21 19:11:24 +0200
committerUrgau <urgau@numericable.fr>2023-10-27 12:02:54 +0200
commit84a1a689ccc8eb6b8be48f3385bc9b0aeb5c71a6 (patch)
treef3df928db0380ddf656c53d3190243d72f0f75d2 /compiler/rustc_interface
parent1ef96a9e06124ca3ce95f9ceb3be6f24d0e7154a (diff)
downloadrust-84a1a689ccc8eb6b8be48f3385bc9b0aeb5c71a6.tar.gz
rust-84a1a689ccc8eb6b8be48f3385bc9b0aeb5c71a6.zip
Better guard against wrong input with check-cfg any()
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/interface.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 22188925382..422c2fc65ad 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -311,11 +311,15 @@ pub fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -> Check
                 }
 
                 if any_specified {
-                    if !names.is_empty() || !values.is_empty() || values_any_specified {
+                    if names.is_empty()
+                        && values.is_empty()
+                        && !values_specified
+                        && !values_any_specified
+                    {
+                        check_cfg.exhaustive_names = false;
+                    } else {
                         error!("`cfg(any())` can only be provided in isolation");
                     }
-
-                    check_cfg.exhaustive_names = false;
                 } else {
                     for name in names {
                         check_cfg