diff options
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r-- | crates/hir_def/src/item_tree.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index 5f5b7151a..ae2475b4e 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs | |||
@@ -115,6 +115,10 @@ impl ItemTree { | |||
115 | // still need to collect inner items. | 115 | // still need to collect inner items. |
116 | ctx.lower_inner_items(stmt.syntax()) | 116 | ctx.lower_inner_items(stmt.syntax()) |
117 | }, | 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 | }, | ||
118 | _ => { | 122 | _ => { |
119 | panic!("cannot create item tree from {:?} {}", syntax, syntax); | 123 | panic!("cannot create item tree from {:?} {}", syntax, syntax); |
120 | }, | 124 | }, |