Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/body/lower.rs')
| -rw-r--r-- | crates/hir_def/src/body/lower.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index d1cfc501e5..f0cb39ec36 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -506,7 +506,8 @@ impl ExprCollector<'_> { None => self.alloc_expr(Expr::Missing, syntax_ptr), } } - ast::Expr::MacroCall(e) => { + ast::Expr::MacroExpr(e) => { + let e = e.macro_call()?; let macro_ptr = AstPtr::new(&e); let id = self.collect_macro_call(e, macro_ptr.clone(), true, |this, expansion| { expansion.map(|it| this.collect_expr(it)) @@ -629,7 +630,11 @@ impl ExprCollector<'_> { } let has_semi = stmt.semicolon_token().is_some(); // Note that macro could be expended to multiple statements - if let Some(ast::Expr::MacroCall(m)) = stmt.expr() { + if let Some(ast::Expr::MacroExpr(e)) = stmt.expr() { + let m = match e.macro_call() { + Some(it) => it, + None => return, + }; let macro_ptr = AstPtr::new(&m); let syntax_ptr = AstPtr::new(&stmt.expr().unwrap()); |