diff options
author | Seivan Heidari <[email protected]> | 2019-11-21 00:11:41 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-21 00:11:41 +0000 |
commit | 358a1bcd708c622836723e5201b6de77cc9ff327 (patch) | |
tree | aeff9c96a6059fa2b02e7c87ec88753bc7993d8d /crates/ra_hir/src/expr.rs | |
parent | 1e2d090ab8a9bda18f148b894b7948eb05b976e6 (diff) | |
parent | 612a72fc4ea4376920f2a7da7b3c334227c1716c (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index e3733779e..869879bdf 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -11,6 +11,7 @@ use rustc_hash::FxHashSet; | |||
11 | use crate::{ | 11 | use crate::{ |
12 | db::HirDatabase, | 12 | db::HirDatabase, |
13 | diagnostics::{MissingFields, MissingOkInTailExpr}, | 13 | diagnostics::{MissingFields, MissingOkInTailExpr}, |
14 | resolve::HasResolver, | ||
14 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, | 15 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, |
15 | Adt, DefWithBody, Function, HasBody, Name, Path, Resolver, | 16 | Adt, DefWithBody, Function, HasBody, Name, Path, Resolver, |
16 | }; | 17 | }; |
@@ -116,7 +117,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
116 | let source_map = self.func.body_source_map(db); | 117 | let source_map = self.func.body_source_map(db); |
117 | 118 | ||
118 | if let Some(source_ptr) = source_map.expr_syntax(id) { | 119 | if let Some(source_ptr) = source_map.expr_syntax(id) { |
119 | if let Some(expr) = source_ptr.ast.a() { | 120 | if let Some(expr) = source_ptr.value.a() { |
120 | let root = source_ptr.file_syntax(db); | 121 | let root = source_ptr.file_syntax(db); |
121 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { | 122 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { |
122 | if let Some(field_list) = record_lit.record_field_list() { | 123 | if let Some(field_list) = record_lit.record_field_list() { |
@@ -161,7 +162,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
161 | let source_map = self.func.body_source_map(db); | 162 | let source_map = self.func.body_source_map(db); |
162 | 163 | ||
163 | if let Some(source_ptr) = source_map.expr_syntax(id) { | 164 | if let Some(source_ptr) = source_map.expr_syntax(id) { |
164 | if let Some(expr) = source_ptr.ast.a() { | 165 | if let Some(expr) = source_ptr.value.a() { |
165 | self.sink.push(MissingOkInTailExpr { file: source_ptr.file_id, expr }); | 166 | self.sink.push(MissingOkInTailExpr { file: source_ptr.file_id, expr }); |
166 | } | 167 | } |
167 | } | 168 | } |