diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-06 13:58:28 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-06 13:58:28 +0100 |
commit | ba3148159974b4fa7a2e37ade3a79ba5eeb4e760 (patch) | |
tree | b5b9eb1151c6fdbfcbeeaaf4dfd2b2db015a6266 /crates/ra_hir/src/ty | |
parent | b79e6294a68fd41f0a3dbd9eb907dfe99646d77e (diff) | |
parent | 505b8d873ffe422358bb4ff47dc82d6c76d0772e (diff) |
Merge #1380
1380: [#1083] Try block syntax r=matklad a=andreytkachenko
The `try` block syntax
Co-authored-by: Andrey Tkachenko <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 905fe9f0e..6cc5dbc6f 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -946,6 +946,11 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
946 | then_ty | 946 | then_ty |
947 | } | 947 | } |
948 | Expr::Block { statements, tail } => self.infer_block(statements, *tail, expected), | 948 | Expr::Block { statements, tail } => self.infer_block(statements, *tail, expected), |
949 | Expr::TryBlock { body } => { | ||
950 | let _inner = self.infer_expr(*body, expected); | ||
951 | // FIXME should be std::result::Result<{inner}, _> | ||
952 | Ty::Unknown | ||
953 | } | ||
949 | Expr::Loop { body } => { | 954 | Expr::Loop { body } => { |
950 | self.infer_expr(*body, &Expectation::has_type(Ty::unit())); | 955 | self.infer_expr(*body, &Expectation::has_type(Ty::unit())); |
951 | // FIXME handle break with value | 956 | // FIXME handle break with value |