diff options
| author | bors <bors@rust-lang.org> | 2025-04-03 22:26:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-03 22:26:29 +0000 |
| commit | 4fd8c04da0674af2c51310c9982370bfadfa1b98 (patch) | |
| tree | 7aee17dc3b8ceab21f70145eb63978256e6ae775 /compiler/rustc_interface/src/interface.rs | |
| parent | 00095b3da4f23d9b3e7a809ac6a4e2b2530df84c (diff) | |
| parent | 4cf6c21f3afebd54653c92d3bb7efc4e662042c7 (diff) | |
| download | rust-4fd8c04da0674af2c51310c9982370bfadfa1b98.tar.gz rust-4fd8c04da0674af2c51310c9982370bfadfa1b98.zip | |
Auto merge of #139336 - matthiaskrgr:rollup-zsi8pgf, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #138017 (Tighten up assignment operator representations.) - #138462 (Dedup `&mut *` reborrow suggestion in loops) - #138610 (impl !PartialOrd for HirId) - #138767 (Allow boolean literals in `check-cfg`) - #139068 (io: Avoid marking some bytes as uninit) - #139255 (Remove unused variables generated in merged doctests) - #139270 (Add a mailmap entry for myself) - #139303 (Put Noratrieb on vacation) - #139312 (add Marco Ieni to mailmap) r? `@ghost` `@rustbot` modify labels: rollup
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() { |
