diff options
Diffstat (limited to 'src/tools/rust-analyzer/crates/mbe/src/expander.rs')
-rw-r--r-- | src/tools/rust-analyzer/crates/mbe/src/expander.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/mbe/src/expander.rs b/src/tools/rust-analyzer/crates/mbe/src/expander.rs index 7537dc322..8e2181e97 100644 --- a/src/tools/rust-analyzer/crates/mbe/src/expander.rs +++ b/src/tools/rust-analyzer/crates/mbe/src/expander.rs @@ -13,10 +13,11 @@ use crate::{parser::MetaVarKind, tt, ExpandError, ExpandResult}; pub(crate) fn expand_rules( rules: &[crate::Rule], input: &tt::Subtree, + is_2021: bool, ) -> ExpandResult<tt::Subtree> { let mut match_: Option<(matcher::Match, &crate::Rule)> = None; for rule in rules { - let new_match = matcher::match_(&rule.lhs, input); + let new_match = matcher::match_(&rule.lhs, input, is_2021); if new_match.err.is_none() { // If we find a rule that applies without errors, we're done. @@ -45,7 +46,7 @@ pub(crate) fn expand_rules( transcriber::transcribe(&rule.rhs, &match_.bindings); ExpandResult { value, err: match_.err.or(transcribe_err) } } else { - ExpandResult::with_err( + ExpandResult::new( tt::Subtree { delimiter: tt::Delimiter::unspecified(), token_trees: vec![] }, ExpandError::NoMatchingRule, ) |