diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-06 14:19:58 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-06 14:19:58 +0000 |
commit | 1cc6879576b04850db3dd8aa1df0cf7c8f270503 (patch) | |
tree | 9221e6742315cc0faa8cdec5d44852afcf7d28e1 /crates/ra_hir_ty/src/expr.rs | |
parent | 5947c1f8b52deb4fcfd97970ba6eb473f092cb94 (diff) | |
parent | 57da3df99a52ccedd7a684d2053db766e5681a61 (diff) |
Merge #3489
3489: More robust expression lowering r=matklad a=matklad
Closes #2236
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index 22f24890d..d8cdf5266 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs | |||
@@ -100,7 +100,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
100 | } | 100 | } |
101 | let (_, source_map) = db.body_with_source_map(self.func.into()); | 101 | let (_, source_map) = db.body_with_source_map(self.func.into()); |
102 | 102 | ||
103 | if let Some(source_ptr) = source_map.expr_syntax(id) { | 103 | if let Ok(source_ptr) = source_map.expr_syntax(id) { |
104 | if let Some(expr) = source_ptr.value.left() { | 104 | if let Some(expr) = source_ptr.value.left() { |
105 | let root = source_ptr.file_syntax(db); | 105 | let root = source_ptr.file_syntax(db); |
106 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { | 106 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { |
@@ -145,7 +145,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
145 | if params.len() == 2 && params[0] == mismatch.actual { | 145 | if params.len() == 2 && params[0] == mismatch.actual { |
146 | let (_, source_map) = db.body_with_source_map(self.func.into()); | 146 | let (_, source_map) = db.body_with_source_map(self.func.into()); |
147 | 147 | ||
148 | if let Some(source_ptr) = source_map.expr_syntax(id) { | 148 | if let Ok(source_ptr) = source_map.expr_syntax(id) { |
149 | if let Some(expr) = source_ptr.value.left() { | 149 | if let Some(expr) = source_ptr.value.left() { |
150 | self.sink.push(MissingOkInTailExpr { file: source_ptr.file_id, expr }); | 150 | self.sink.push(MissingOkInTailExpr { file: source_ptr.file_id, expr }); |
151 | } | 151 | } |