aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/mbe_expander.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs
index 7adb70d45..b1eacf124 100644
--- a/crates/ra_mbe/src/mbe_expander.rs
+++ b/crates/ra_mbe/src/mbe_expander.rs
@@ -34,8 +34,7 @@ fn expand_rules(rules: &[crate::Rule], input: &tt::Subtree) -> ExpandResult<tt::
34 return ExpandResult::ok(res); 34 return ExpandResult::ok(res);
35 } 35 }
36 } 36 }
37 // Use the rule if we matched more tokens, or had fewer patterns left, 37 // Use the rule if we matched more tokens, or had fewer errors
38 // or had no error
39 if let Some((prev_match, _)) = &match_ { 38 if let Some((prev_match, _)) = &match_ {
40 if (new_match.unmatched_tts, new_match.err_count) 39 if (new_match.unmatched_tts, new_match.err_count)
41 < (prev_match.unmatched_tts, prev_match.err_count) 40 < (prev_match.unmatched_tts, prev_match.err_count)
@@ -176,7 +175,6 @@ mod tests {
176 let (invocation_tt, _) = 175 let (invocation_tt, _) =
177 ast_to_token_tree(&macro_invocation.token_tree().unwrap()).unwrap(); 176 ast_to_token_tree(&macro_invocation.token_tree().unwrap()).unwrap();
178 177
179 let expanded = expand_rules(&rules.rules, &invocation_tt); 178 expand_rules(&rules.rules, &invocation_tt)
180 expanded
181 } 179 }
182} 180}