diff options
author | Lukas Wirth <[email protected]> | 2020-12-23 11:15:38 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-12-23 11:15:38 +0000 |
commit | 0a780c0ab3869d92fb56ae3b2ddc7636fb169314 (patch) | |
tree | 9323c15986fdb61054e972fcebf88717f1ebb277 /crates/hir_def/src/body | |
parent | fd1fcf2c2e90ab04103a6aa9d033ec64dcc8d555 (diff) |
Implement const pat inference
Diffstat (limited to 'crates/hir_def/src/body')
-rw-r--r-- | crates/hir_def/src/body/lower.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 978c3a324..4492a7d77 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs | |||
@@ -932,10 +932,16 @@ impl ExprCollector<'_> { | |||
932 | let inner = self.collect_pat_opt(boxpat.pat()); | 932 | let inner = self.collect_pat_opt(boxpat.pat()); |
933 | Pat::Box { inner } | 933 | Pat::Box { inner } |
934 | } | 934 | } |
935 | // FIXME: implement | 935 | ast::Pat::ConstBlockPat(const_block_pat) => { |
936 | ast::Pat::RangePat(_) | ast::Pat::MacroPat(_) | ast::Pat::ConstBlockPat(_) => { | 936 | if let Some(expr) = const_block_pat.block_expr() { |
937 | Pat::Missing | 937 | let expr_id = self.collect_block(expr); |
938 | Pat::ConstBlock(expr_id) | ||
939 | } else { | ||
940 | Pat::Missing | ||
941 | } | ||
938 | } | 942 | } |
943 | // FIXME: implement | ||
944 | ast::Pat::RangePat(_) | ast::Pat::MacroPat(_) => Pat::Missing, | ||
939 | }; | 945 | }; |
940 | let ptr = AstPtr::new(&pat); | 946 | let ptr = AstPtr::new(&pat); |
941 | self.alloc_pat(pattern, Either::Left(ptr)) | 947 | self.alloc_pat(pattern, Either::Left(ptr)) |