diff options
author | Lukas Wirth <[email protected]> | 2020-12-23 11:24:24 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-12-23 11:24:24 +0000 |
commit | a142beaf013a016a48eb9f193b55e0cbcb80b6a9 (patch) | |
tree | 6445b1e3de954913766b0b53aad15ebdd100a587 /crates/hir_def/src/body | |
parent | 0a780c0ab3869d92fb56ae3b2ddc7636fb169314 (diff) |
Implement const block inference
Diffstat (limited to 'crates/hir_def/src/body')
-rw-r--r-- | crates/hir_def/src/body/lower.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 4492a7d77..1b98504bb 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs | |||
@@ -246,6 +246,10 @@ impl ExprCollector<'_> { | |||
246 | let body = self.collect_block_opt(e.block_expr()); | 246 | let body = self.collect_block_opt(e.block_expr()); |
247 | self.alloc_expr(Expr::Async { body }, syntax_ptr) | 247 | self.alloc_expr(Expr::Async { body }, syntax_ptr) |
248 | } | 248 | } |
249 | ast::Effect::Const(_) => { | ||
250 | let body = self.collect_block_opt(e.block_expr()); | ||
251 | self.alloc_expr(Expr::Const { body }, syntax_ptr) | ||
252 | } | ||
249 | }, | 253 | }, |
250 | ast::Expr::BlockExpr(e) => self.collect_block(e), | 254 | ast::Expr::BlockExpr(e) => self.collect_block(e), |
251 | ast::Expr::LoopExpr(e) => { | 255 | ast::Expr::LoopExpr(e) => { |