diff options
author | Aleksey Kladov <[email protected]> | 2019-11-24 15:48:29 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-24 16:01:19 +0000 |
commit | 434f108adad75b7c5e25db745a9f9fefa5cdaa31 (patch) | |
tree | 82a4925ddcd24fce7646e36615e192ad0bf63b44 /crates/ra_hir | |
parent | f5e0a31eaf9ddd7788e6261d49f4d18e8463a719 (diff) |
Simplify
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/test_db.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 6b703d8b4..43fedde7a 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -44,15 +44,15 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
44 | pub(crate) fn validate_body(&mut self, db: &impl HirDatabase) { | 44 | pub(crate) fn validate_body(&mut self, db: &impl HirDatabase) { |
45 | let body = self.func.body(db); | 45 | let body = self.func.body(db); |
46 | 46 | ||
47 | for e in body.exprs() { | 47 | for e in body.exprs.iter() { |
48 | if let (id, Expr::RecordLit { path, fields, spread }) = e { | 48 | if let (id, Expr::RecordLit { path, fields, spread }) = e { |
49 | self.validate_record_literal(id, path, fields, *spread, db); | 49 | self.validate_record_literal(id, path, fields, *spread, db); |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | let body_expr = &body[body.body_expr()]; | 53 | let body_expr = &body[body.body_expr]; |
54 | if let Expr::Block { statements: _, tail: Some(t) } = body_expr { | 54 | if let Expr::Block { statements: _, tail: Some(t) } = body_expr { |
55 | self.validate_results_in_tail_expr(body.body_expr(), *t, db); | 55 | self.validate_results_in_tail_expr(body.body_expr, *t, db); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
diff --git a/crates/ra_hir/src/test_db.rs b/crates/ra_hir/src/test_db.rs index 03c7ac155..efee2f658 100644 --- a/crates/ra_hir/src/test_db.rs +++ b/crates/ra_hir/src/test_db.rs | |||
@@ -80,7 +80,7 @@ impl TestDB { | |||
80 | let crate_graph = self.crate_graph(); | 80 | let crate_graph = self.crate_graph(); |
81 | for krate in crate_graph.iter().next() { | 81 | for krate in crate_graph.iter().next() { |
82 | let crate_def_map = self.crate_def_map(krate); | 82 | let crate_def_map = self.crate_def_map(krate); |
83 | for module_id in crate_def_map.modules() { | 83 | for (module_id, _) in crate_def_map.modules.iter() { |
84 | let module_id = ModuleId { krate, module_id }; | 84 | let module_id = ModuleId { krate, module_id }; |
85 | let module = crate::Module::from(module_id); | 85 | let module = crate::Module::from(module_id); |
86 | module.diagnostics( | 86 | module.diagnostics( |
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 471bdc387..2e744e5ec 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -565,7 +565,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
565 | 565 | ||
566 | fn collect_fn(&mut self, data: &FunctionData) { | 566 | fn collect_fn(&mut self, data: &FunctionData) { |
567 | let body = Arc::clone(&self.body); // avoid borrow checker problem | 567 | let body = Arc::clone(&self.body); // avoid borrow checker problem |
568 | for (type_ref, pat) in data.params.iter().zip(body.params()) { | 568 | for (type_ref, pat) in data.params.iter().zip(body.params.iter()) { |
569 | let ty = self.make_ty(type_ref); | 569 | let ty = self.make_ty(type_ref); |
570 | 570 | ||
571 | self.infer_pat(*pat, &ty, BindingMode::default()); | 571 | self.infer_pat(*pat, &ty, BindingMode::default()); |
@@ -574,7 +574,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
574 | } | 574 | } |
575 | 575 | ||
576 | fn infer_body(&mut self) { | 576 | fn infer_body(&mut self) { |
577 | self.infer_expr(self.body.body_expr(), &Expectation::has_type(self.return_ty.clone())); | 577 | self.infer_expr(self.body.body_expr, &Expectation::has_type(self.return_ty.clone())); |
578 | } | 578 | } |
579 | 579 | ||
580 | fn resolve_into_iter_item(&self) -> Option<TypeAlias> { | 580 | fn resolve_into_iter_item(&self) -> Option<TypeAlias> { |