diff options
| author | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-04-07 04:12:22 +0000 |
|---|---|---|
| committer | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-04-07 04:12:22 +0000 |
| commit | 5a28e1e8de868757716d97aa0c0c1d7764122c32 (patch) | |
| tree | 2478093c3b93e98d9a90c99a012c6862eedd96f3 /compiler/rustc_interface/src/interface.rs | |
| parent | f74e85e2c2567d8fc3b1248944def8ed0ab22399 (diff) | |
| parent | 25a615bf829b9f6d6f22da537e3851043f92e5f2 (diff) | |
| download | rust-5a28e1e8de868757716d97aa0c0c1d7764122c32.tar.gz rust-5a28e1e8de868757716d97aa0c0c1d7764122c32.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 3f87b1a547b..33b4a48b28d 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -204,6 +204,14 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch error!("`cfg()` names cannot be after values"); } names.push(ident); + } else if let Some(boolean) = arg.boolean_literal() { + if values_specified { + error!("`cfg()` names cannot be after values"); + } + names.push(rustc_span::Ident::new( + if boolean { rustc_span::kw::True } else { rustc_span::kw::False }, + arg.span(), + )); } else if arg.has_name(sym::any) && let Some(args) = arg.meta_item_list() { |
