diff options
| author | Urgau <urgau@numericable.fr> | 2023-10-21 19:11:24 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2023-10-27 12:02:54 +0200 |
| commit | 84a1a689ccc8eb6b8be48f3385bc9b0aeb5c71a6 (patch) | |
| tree | f3df928db0380ddf656c53d3190243d72f0f75d2 /compiler/rustc_interface | |
| parent | 1ef96a9e06124ca3ce95f9ceb3be6f24d0e7154a (diff) | |
| download | rust-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.rs | 10 |
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 |
