diff options
author | Edwin Cheng <[email protected]> | 2021-03-18 11:39:40 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2021-03-18 12:19:15 +0000 |
commit | 13f30e9ef5f3d78fdaef450e935782a2edd9f88e (patch) | |
tree | fd0d6f5e6c3123ddd59479c9f43901abcc19ea27 /crates/hir_def/src/item_tree | |
parent | f7fbea509f1e5f840e715c912ee38aa997d1bfbc (diff) |
Handle inner recursive macro rules cases
Diffstat (limited to 'crates/hir_def/src/item_tree')
-rw-r--r-- | crates/hir_def/src/item_tree/lower.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index 7e91b991d..d684b89d0 100644 --- a/crates/hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs | |||
@@ -87,6 +87,14 @@ impl Ctx { | |||
87 | self.tree | 87 | self.tree |
88 | } | 88 | } |
89 | 89 | ||
90 | pub(super) fn lower_single_item(mut self, item: ast::Item) -> ItemTree { | ||
91 | self.tree.top_level = self | ||
92 | .lower_mod_item(&item, false) | ||
93 | .map(|item| item.0) | ||
94 | .unwrap_or_else(|| Default::default()); | ||
95 | self.tree | ||
96 | } | ||
97 | |||
90 | pub(super) fn lower_inner_items(mut self, within: &SyntaxNode) -> ItemTree { | 98 | pub(super) fn lower_inner_items(mut self, within: &SyntaxNode) -> ItemTree { |
91 | self.collect_inner_items(within); | 99 | self.collect_inner_items(within); |
92 | self.tree | 100 | self.tree |