aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-20 17:18:52 +0000
committerGitHub <[email protected]>2019-12-20 17:18:52 +0000
commit99d6f544f2a590d3feef47ce62d5cd9a8b463a47 (patch)
treeae4e2dd0ae2c62baf79ec1197f5ec5f94a7645e5 /crates/ra_hir_def/src
parentcfc50ff160d0af2ce5cd931c6d41161abfdb2fbd (diff)
parent2a8c9100bfb1294a469bc039a5b9597eabed7073 (diff)
Merge #2616
2616: Handle closure return types r=flodiebold a=flodiebold Fixes #2547. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs3
-rw-r--r--crates/ra_hir_def/src/expr.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 853e17bae..be5d17d85 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -372,8 +372,9 @@ where
372 arg_types.push(type_ref); 372 arg_types.push(type_ref);
373 } 373 }
374 } 374 }
375 let ret_type = e.ret_type().and_then(|r| r.type_ref()).map(TypeRef::from_ast);
375 let body = self.collect_expr_opt(e.body()); 376 let body = self.collect_expr_opt(e.body());
376 self.alloc_expr(Expr::Lambda { args, arg_types, body }, syntax_ptr) 377 self.alloc_expr(Expr::Lambda { args, arg_types, ret_type, body }, syntax_ptr)
377 } 378 }
378 ast::Expr::BinExpr(e) => { 379 ast::Expr::BinExpr(e) => {
379 let lhs = self.collect_expr_opt(e.lhs()); 380 let lhs = self.collect_expr_opt(e.lhs());
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs
index 6fad80a8d..a75ef9970 100644
--- a/crates/ra_hir_def/src/expr.rs
+++ b/crates/ra_hir_def/src/expr.rs
@@ -143,6 +143,7 @@ pub enum Expr {
143 Lambda { 143 Lambda {
144 args: Vec<PatId>, 144 args: Vec<PatId>,
145 arg_types: Vec<Option<TypeRef>>, 145 arg_types: Vec<Option<TypeRef>>,
146 ret_type: Option<TypeRef>,
146 body: ExprId, 147 body: ExprId,
147 }, 148 },
148 Tuple { 149 Tuple {