diff options
author | Edwin Cheng <[email protected]> | 2021-03-25 19:52:35 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2021-03-25 20:21:15 +0000 |
commit | 8ce15b02dea7152953775904fd937cced2422bc6 (patch) | |
tree | 7ae4be1d4da3bd083fe0bec65f9ed4f5db8eb8c4 /crates/hir_def/src/item_tree.rs | |
parent | 59fdd7c84c5fdc16573f3cca4081d6735eaa9208 (diff) |
Fix recursive macro statement expansion
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r-- | crates/hir_def/src/item_tree.rs | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index ae2475b4e..ca0048b16 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs | |||
@@ -110,15 +110,6 @@ impl ItemTree { | |||
110 | // still need to collect inner items. | 110 | // still need to collect inner items. |
111 | ctx.lower_inner_items(e.syntax()) | 111 | ctx.lower_inner_items(e.syntax()) |
112 | }, | 112 | }, |
113 | ast::ExprStmt(stmt) => { | ||
114 | // Macros can expand to stmt. We return an empty item tree in this case, but | ||
115 | // still need to collect inner items. | ||
116 | ctx.lower_inner_items(stmt.syntax()) | ||
117 | }, | ||
118 | ast::Item(item) => { | ||
119 | // Macros can expand to stmt and other item, and we add it as top level item | ||
120 | ctx.lower_single_item(item) | ||
121 | }, | ||
122 | _ => { | 113 | _ => { |
123 | panic!("cannot create item tree from {:?} {}", syntax, syntax); | 114 | panic!("cannot create item tree from {:?} {}", syntax, syntax); |
124 | }, | 115 | }, |