mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Fixed nested eager macro bug
This commit is contained in:
parent
895d97cfa0
commit
26b9c793f1
2 changed files with 52 additions and 0 deletions
|
@ -218,6 +218,12 @@ fn eager_macro_recur(
|
|||
}
|
||||
};
|
||||
|
||||
// check if the whole original sytnax is replaced
|
||||
// Note that SyntaxRewriter cannot replace the root node itself
|
||||
if child.syntax() == &original {
|
||||
return Ok(insert);
|
||||
}
|
||||
|
||||
rewriter.replace(child.syntax(), &insert);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue