Allow boolean literals in check-cfg
This commit is contained in:
parent
78948ac259
commit
3df2acd31b
6 changed files with 31 additions and 24 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue