aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/body
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/body')
-rw-r--r--crates/hir_def/src/body/lower.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index e1de39d0c..17c72779b 100644
--- a/crates/hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
@@ -263,6 +263,10 @@ impl ExprCollector<'_> {
263 let body = self.collect_block_opt(e.block_expr()); 263 let body = self.collect_block_opt(e.block_expr());
264 self.alloc_expr(Expr::Async { body }, syntax_ptr) 264 self.alloc_expr(Expr::Async { body }, syntax_ptr)
265 } 265 }
266 ast::Effect::Const(_) => {
267 let body = self.collect_block_opt(e.block_expr());
268 self.alloc_expr(Expr::Const { body }, syntax_ptr)
269 }
266 }, 270 },
267 ast::Expr::BlockExpr(e) => self.collect_block(e), 271 ast::Expr::BlockExpr(e) => self.collect_block(e),
268 ast::Expr::LoopExpr(e) => { 272 ast::Expr::LoopExpr(e) => {
@@ -930,10 +934,16 @@ impl ExprCollector<'_> {
930 let inner = self.collect_pat_opt(boxpat.pat()); 934 let inner = self.collect_pat_opt(boxpat.pat());
931 Pat::Box { inner } 935 Pat::Box { inner }
932 } 936 }
933 // FIXME: implement 937 ast::Pat::ConstBlockPat(const_block_pat) => {
934 ast::Pat::RangePat(_) | ast::Pat::MacroPat(_) | ast::Pat::ConstBlockPat(_) => { 938 if let Some(expr) = const_block_pat.block_expr() {
935 Pat::Missing 939 let expr_id = self.collect_block(expr);
940 Pat::ConstBlock(expr_id)
941 } else {
942 Pat::Missing
943 }
936 } 944 }
945 // FIXME: implement
946 ast::Pat::RangePat(_) | ast::Pat::MacroPat(_) => Pat::Missing,
937 }; 947 };
938 let ptr = AstPtr::new(&pat); 948 let ptr = AstPtr::new(&pat);
939 self.alloc_pat(pattern, Either::Left(ptr)) 949 self.alloc_pat(pattern, Either::Left(ptr))