diff options
| author | Urgau <urgau@numericable.fr> | 2024-09-19 10:13:14 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-10-01 10:01:33 +0200 |
| commit | c99f29b29fa4115436c352a921f9963b173b5608 (patch) | |
| tree | 3155bff264b180fb1af9e63f4ad477565a805e17 /compiler/rustc_expand/src/config.rs | |
| parent | 57b9b1f9745a56943cc0aebc4c3ec487945f044e (diff) | |
| download | rust-c99f29b29fa4115436c352a921f9963b173b5608.tar.gz rust-c99f29b29fa4115436c352a921f9963b173b5608.zip | |
Implement boolean lit support in cfg predicates
Diffstat (limited to 'compiler/rustc_expand/src/config.rs')
| -rw-r--r-- | compiler/rustc_expand/src/config.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 8ea4f901368..af56169fd60 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -466,9 +466,9 @@ pub fn parse_cfg<'a>(meta_item: &'a MetaItem, sess: &Session) -> Option<&'a Nest sess.dcx().emit_err(InvalidCfg::MultiplePredicates { span: l.span() }); None } - Some([single]) => match single.is_meta_item() { - true => Some(single), - false => { + Some([single]) => match single.meta_item_or_bool() { + Some(meta_item) => Some(meta_item), + None => { sess.dcx().emit_err(InvalidCfg::PredicateLiteral { span: single.span() }); None } |
