aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-02 00:12:37 +0100
committerAleksey Kladov <[email protected]>2020-05-02 00:12:37 +0100
commitfd030f9450ed6910677e30f8fa65b06e71fcffa2 (patch)
tree27298926ab8ffa68cfef463bd37d6564ffb417dd /crates/ra_hir_def
parenta984587c47a8ad8b7dbdae0509089a9f6d898d8d (diff)
Revert "Merge #4233"
This reverts commit a5f2b16366f027ad60c58266a66eb7fbdcbda9f9, reversing changes made to c96b2180c1c4206a0a98c280b4d30897eb116336.
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs4
-rw-r--r--crates/ra_hir_def/src/expr.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index e9dd65b0a..f06cc115b 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -203,6 +203,10 @@ impl ExprCollector<'_> {
203 203
204 self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr) 204 self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr)
205 } 205 }
206 ast::Expr::TryBlockExpr(e) => {
207 let body = self.collect_block_opt(e.body());
208 self.alloc_expr(Expr::TryBlock { body }, syntax_ptr)
209 }
206 ast::Expr::BlockExpr(e) => self.collect_block(e), 210 ast::Expr::BlockExpr(e) => self.collect_block(e),
207 ast::Expr::LoopExpr(e) => { 211 ast::Expr::LoopExpr(e) => {
208 let body = self.collect_block_opt(e.loop_body()); 212 let body = self.collect_block_opt(e.loop_body());
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs
index aad12e123..a0cdad529 100644
--- a/crates/ra_hir_def/src/expr.rs
+++ b/crates/ra_hir_def/src/expr.rs
@@ -101,6 +101,9 @@ pub enum Expr {
101 Try { 101 Try {
102 expr: ExprId, 102 expr: ExprId,
103 }, 103 },
104 TryBlock {
105 body: ExprId,
106 },
104 Cast { 107 Cast {
105 expr: ExprId, 108 expr: ExprId,
106 type_ref: TypeRef, 109 type_ref: TypeRef,
@@ -236,6 +239,7 @@ impl Expr {
236 f(*expr); 239 f(*expr);
237 } 240 }
238 } 241 }
242 Expr::TryBlock { body } => f(*body),
239 Expr::Loop { body } => f(*body), 243 Expr::Loop { body } => f(*body),
240 Expr::While { condition, body } => { 244 Expr::While { condition, body } => {
241 f(*condition); 245 f(*condition);