From 5e096def15e992938b0e2838ae6c344939aa10f2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 8 Dec 2019 12:50:49 +0100 Subject: Expand macros in blocks to expressions for now Expanding to statements isn't handled properly yet and breaks things. --- crates/ra_hir_def/src/body/lower.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 71c08f024..cc068ff94 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -437,9 +437,7 @@ where None => self.alloc_expr(Expr::Missing, syntax_ptr), } } - - // FIXME implement HIR for these: - ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), + // FIXME expand to statements in statement position ast::Expr::MacroCall(e) => match self.expander.enter_expand(self.db, e) { Some((mark, expansion)) => { let id = self.collect_expr(expansion); @@ -448,6 +446,9 @@ where } None => self.alloc_expr(Expr::Missing, syntax_ptr), }, + + // FIXME implement HIR for these: + ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), } } -- cgit v1.2.3