From 8ce15b02dea7152953775904fd937cced2422bc6 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 26 Mar 2021 03:52:35 +0800 Subject: Fix recursive macro statement expansion --- crates/hir_def/src/item_tree.rs | 9 --------- 1 file changed, 9 deletions(-) (limited to 'crates/hir_def/src/item_tree.rs') 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 { // still need to collect inner items. ctx.lower_inner_items(e.syntax()) }, - ast::ExprStmt(stmt) => { - // Macros can expand to stmt. We return an empty item tree in this case, but - // still need to collect inner items. - ctx.lower_inner_items(stmt.syntax()) - }, - ast::Item(item) => { - // Macros can expand to stmt and other item, and we add it as top level item - ctx.lower_single_item(item) - }, _ => { panic!("cannot create item tree from {:?} {}", syntax, syntax); }, -- cgit v1.2.3