aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/eager.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/eager.rs')
-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