diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-27 02:57:02 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-27 02:57:02 +0000 |
commit | c8066ebd1781a6f6f536abe3494477bd69df795a (patch) | |
tree | edf5109d9f0629b0910f4f2ac716bd624330bb00 /crates/hir_def/src/item_tree/lower.rs | |
parent | 9c9376c4cffdd171375fbb21dd3d0f71a97a335e (diff) | |
parent | 8ce15b02dea7152953775904fd937cced2422bc6 (diff) |
Merge #8201
8201: Fix recursive macro statements expansion r=edwin0cheng a=edwin0cheng
This PR attempts to properly handle macro statement expansion by implementing the following:
1. Merge macro expanded statements to parent scope statements.
2. Add a new hir `Expr::MacroStmts` for handle tail expression infer.
PS : The scope of macro expanded statements are so strange that it took more time than I thought to understand and implement it :(
Fixes #8171
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/hir_def/src/item_tree/lower.rs')
-rw-r--r-- | crates/hir_def/src/item_tree/lower.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index d3fe1ce1e..3f558edd8 100644 --- a/crates/hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs | |||
@@ -87,14 +87,6 @@ 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 | |||
98 | pub(super) fn lower_inner_items(mut self, within: &SyntaxNode) -> ItemTree { | 90 | pub(super) fn lower_inner_items(mut self, within: &SyntaxNode) -> ItemTree { |
99 | self.collect_inner_items(within); | 91 | self.collect_inner_items(within); |
100 | self.tree | 92 | self.tree |