diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 20:03:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 20:03:25 +0100 |
commit | 239dd506f68db0cbe4417b6e5c7f737d8ff8a159 (patch) | |
tree | dd3503a2be3a6699a6b111844dbcdc85b37e2425 /crates/ra_hir_def/src/body | |
parent | 134d3c3c5068abc5ed3e03fe5df2b524ea70753d (diff) | |
parent | f95f425ae4199e814e6956be1d9bb59a14758c07 (diff) |
Merge #5613
5613: Use ty to access most TypeRefs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 288ca76c3..827ced4ad 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -432,7 +432,7 @@ impl ExprCollector<'_> { | |||
432 | } | 432 | } |
433 | ast::Expr::CastExpr(e) => { | 433 | ast::Expr::CastExpr(e) => { |
434 | let expr = self.collect_expr_opt(e.expr()); | 434 | let expr = self.collect_expr_opt(e.expr()); |
435 | let type_ref = TypeRef::from_ast_opt(&self.ctx(), e.type_ref()); | 435 | let type_ref = TypeRef::from_ast_opt(&self.ctx(), e.ty()); |
436 | self.alloc_expr(Expr::Cast { expr, type_ref }, syntax_ptr) | 436 | self.alloc_expr(Expr::Cast { expr, type_ref }, syntax_ptr) |
437 | } | 437 | } |
438 | ast::Expr::RefExpr(e) => { | 438 | ast::Expr::RefExpr(e) => { |
@@ -471,10 +471,8 @@ impl ExprCollector<'_> { | |||
471 | arg_types.push(type_ref); | 471 | arg_types.push(type_ref); |
472 | } | 472 | } |
473 | } | 473 | } |
474 | let ret_type = e | 474 | let ret_type = |
475 | .ret_type() | 475 | e.ret_type().and_then(|r| r.ty()).map(|it| TypeRef::from_ast(&self.ctx(), it)); |
476 | .and_then(|r| r.type_ref()) | ||
477 | .map(|it| TypeRef::from_ast(&self.ctx(), it)); | ||
478 | let body = self.collect_expr_opt(e.body()); | 476 | let body = self.collect_expr_opt(e.body()); |
479 | self.alloc_expr(Expr::Lambda { args, arg_types, ret_type, body }, syntax_ptr) | 477 | self.alloc_expr(Expr::Lambda { args, arg_types, ret_type, body }, syntax_ptr) |
480 | } | 478 | } |