From 281c9eeaff8eac4e666089f80f67cf684e1d001b Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Thu, 6 Jun 2019 15:36:16 +0400 Subject: [#1083] Try block syntax --- crates/ra_hir/src/ty/infer.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_hir/src/ty/infer.rs') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 905fe9f0e..579307d8a 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -946,6 +946,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { then_ty } Expr::Block { statements, tail } => self.infer_block(statements, *tail, expected), + Expr::TryBlock { body } => { + let _inner = self.infer_expr(*body, expected); + + // FIXME should be std::result::Result<{inner}, _> + Ty::Unknown + } Expr::Loop { body } => { self.infer_expr(*body, &Expectation::has_type(Ty::unit())); // FIXME handle break with value -- cgit v1.2.3 From 505b8d873ffe422358bb4ff47dc82d6c76d0772e Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Thu, 6 Jun 2019 16:26:54 +0400 Subject: [#1083] Try block syntax: fix tests --- crates/ra_hir/src/ty/infer.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/ra_hir/src/ty/infer.rs') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 579307d8a..6cc5dbc6f 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -948,7 +948,6 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { Expr::Block { statements, tail } => self.infer_block(statements, *tail, expected), Expr::TryBlock { body } => { let _inner = self.infer_expr(*body, expected); - // FIXME should be std::result::Result<{inner}, _> Ty::Unknown } -- cgit v1.2.3