aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/infer/expr.rs')
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs
index a9565a58d..22884522a 100644
--- a/crates/ra_hir_ty/src/infer/expr.rs
+++ b/crates/ra_hir_ty/src/infer/expr.rs
@@ -142,6 +142,7 @@ impl<'a> InferenceContext<'a> {
142 // FIXME: Breakable block inference 142 // FIXME: Breakable block inference
143 self.infer_block(statements, *tail, expected) 143 self.infer_block(statements, *tail, expected)
144 } 144 }
145 Expr::Unsafe { body } => self.infer_expr(*body, expected),
145 Expr::TryBlock { body } => { 146 Expr::TryBlock { body } => {
146 let _inner = self.infer_expr(*body, expected); 147 let _inner = self.infer_expr(*body, expected);
147 // FIXME should be std::result::Result<{inner}, _> 148 // FIXME should be std::result::Result<{inner}, _>
@@ -784,11 +785,7 @@ impl<'a> InferenceContext<'a> {
784 for &check_closures in &[false, true] { 785 for &check_closures in &[false, true] {
785 let param_iter = param_tys.iter().cloned().chain(repeat(Ty::Unknown)); 786 let param_iter = param_tys.iter().cloned().chain(repeat(Ty::Unknown));
786 for (&arg, param_ty) in args.iter().zip(param_iter) { 787 for (&arg, param_ty) in args.iter().zip(param_iter) {
787 let is_closure = match &self.body[arg] { 788 let is_closure = matches!(&self.body[arg], Expr::Lambda { .. });
788 Expr::Lambda { .. } => true,
789 _ => false,
790 };
791
792 if is_closure != check_closures { 789 if is_closure != check_closures {
793 continue; 790 continue;
794 } 791 }