mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Make sure we match the entire pattern
This commit is contained in:
parent
f370393bba
commit
dbc3074556
2 changed files with 34 additions and 1 deletions
|
@ -13,6 +13,9 @@ pub(crate) fn exapnd(rules: &crate::MacroRules, input: &tt::Subtree) -> Option<t
|
|||
fn expand_rule(rule: &crate::Rule, input: &tt::Subtree) -> Option<tt::Subtree> {
|
||||
let mut input = TtCursor::new(input);
|
||||
let bindings = match_lhs(&rule.lhs, &mut input)?;
|
||||
if !input.is_eof() {
|
||||
return None;
|
||||
}
|
||||
expand_subtree(&rule.rhs, &bindings, &mut Vec::new())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue