aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-11 00:33:18 +0100
committerGitHub <[email protected]>2021-04-11 00:33:18 +0100
commiteccd0efedb230985c582edbf9d272bf5f0224acf (patch)
treee9d878c43c5b487a8788ea2000e6e00cac883cc2 /crates/hir_def/src/item_tree.rs
parenta8a25863f6e1e6da94b60813b2daee73b55132f7 (diff)
parente2c1da36f59cd99d4da4c1d5f8f323626d3dbe61 (diff)
Merge #8463
8463: Support macros in pattern position r=jonas-schievink a=jonas-schievink This was fairly easy, because patterns are limited to bodies, so almost all changes were inside body lowering. Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index 240662486..94e08f835 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -99,6 +99,11 @@ impl ItemTree {
99 // items. 99 // items.
100 ctx.lower_macro_stmts(stmts) 100 ctx.lower_macro_stmts(stmts)
101 }, 101 },
102 ast::Pat(_pat) => {
103 // FIXME: This occurs because macros in pattern position are treated as inner
104 // items and expanded during block DefMap computation
105 return Default::default();
106 },
102 ast::Expr(e) => { 107 ast::Expr(e) => {
103 // Macros can expand to expressions. We return an empty item tree in this case, but 108 // Macros can expand to expressions. We return an empty item tree in this case, but
104 // still need to collect inner items. 109 // still need to collect inner items.