From 251ef93ac3bbb138a2eedf6090f2f56f1a15d898 Mon Sep 17 00:00:00 2001 From: oxalica Date: Thu, 10 Sep 2020 20:01:23 +0800 Subject: Implement async blocks --- crates/hir_def/src/body/lower.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/hir_def/src/body') diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 30ac12a12..c5ebc2aa0 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -239,7 +239,10 @@ impl ExprCollector<'_> { None => self.missing_expr(), }, // FIXME: we need to record these effects somewhere... - ast::Effect::Async(_) => self.collect_block_opt(e.block_expr()), + ast::Effect::Async(_) => { + let body = self.collect_block_opt(e.block_expr()); + self.alloc_expr(Expr::Async { body }, syntax_ptr) + } }, ast::Expr::BlockExpr(e) => self.collect_block(e), ast::Expr::LoopExpr(e) => { -- cgit v1.2.3