Implement boolean lit support in cfg predicates
This commit is contained in:
parent
57b9b1f974
commit
c99f29b29f
6 changed files with 48 additions and 6 deletions
|
@ -603,6 +603,7 @@ pub fn eval_condition(
|
|||
|
||||
let cfg = match cfg {
|
||||
ast::NestedMetaItem::MetaItem(meta_item) => meta_item,
|
||||
ast::NestedMetaItem::Lit(MetaItemLit { kind: LitKind::Bool(b), .. }) => return *b,
|
||||
_ => {
|
||||
dcx.emit_err(session_diagnostics::UnsupportedLiteral {
|
||||
span: cfg.span(),
|
||||
|
@ -649,7 +650,7 @@ pub fn eval_condition(
|
|||
}
|
||||
ast::MetaItemKind::List(mis) => {
|
||||
for mi in mis.iter() {
|
||||
if !mi.is_meta_item() {
|
||||
if mi.meta_item_or_bool().is_none() {
|
||||
dcx.emit_err(session_diagnostics::UnsupportedLiteral {
|
||||
span: mi.span(),
|
||||
reason: UnsupportedLiteralReason::Generic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue