aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-03 09:58:32 +0000
committerGitHub <[email protected]>2021-01-03 09:58:32 +0000
commit354c1daedc91abd15ca0ce6ada417053ce45ecfa (patch)
treece9f416dc64893872cba2d25b4012af0183021e1 /crates/hir_expand
parent1cc73d60bbd7149773f2eb57296d5611cbe941b1 (diff)
parent26b9c793f1008e1c5cb1ca61f3c5892f8025f387 (diff)
Merge #7136
7136: Fixed nested eager macro bug r=edwin0cheng a=edwin0cheng fixes #7126 bors r+ Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/eager.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs
index 6354b090d..ae7b51a08 100644
--- a/crates/hir_expand/src/eager.rs
+++ b/crates/hir_expand/src/eager.rs
@@ -218,6 +218,12 @@ fn eager_macro_recur(
218 } 218 }
219 }; 219 };
220 220
221 // check if the whole original sytnax is replaced
222 // Note that SyntaxRewriter cannot replace the root node itself
223 if child.syntax() == &original {
224 return Ok(insert);
225 }
226
221 rewriter.replace(child.syntax(), &insert); 227 rewriter.replace(child.syntax(), &insert);
222 } 228 }
223 229