diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 15 | ||||
-rw-r--r-- | crates/ra_hir/src/source_analyzer.rs | 2 |
2 files changed, 4 insertions, 13 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9222009fe..42c9ca189 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -25,11 +25,8 @@ use hir_expand::{ | |||
25 | use hir_ty::{ | 25 | use hir_ty::{ |
26 | autoderef, | 26 | autoderef, |
27 | display::{HirDisplayError, HirFormatter}, | 27 | display::{HirDisplayError, HirFormatter}, |
28 | expr::ExprValidator, | 28 | method_resolution, ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, |
29 | method_resolution, | 29 | TraitEnvironment, Ty, TyDefId, TypeCtor, |
30 | unsafe_validation::UnsafeValidator, | ||
31 | ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, TraitEnvironment, Ty, | ||
32 | TyDefId, TypeCtor, | ||
33 | }; | 30 | }; |
34 | use ra_db::{CrateId, Edition, FileId}; | 31 | use ra_db::{CrateId, Edition, FileId}; |
35 | use ra_prof::profile; | 32 | use ra_prof::profile; |
@@ -680,13 +677,7 @@ impl Function { | |||
680 | } | 677 | } |
681 | 678 | ||
682 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { | 679 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { |
683 | let _p = profile("Function::diagnostics"); | 680 | hir_ty::diagnostics::validate_body(db, self.id.into(), sink) |
684 | let infer = db.infer(self.id.into()); | ||
685 | infer.add_diagnostics(db, self.id, sink); | ||
686 | let mut validator = ExprValidator::new(self.id, infer.clone(), sink); | ||
687 | validator.validate_body(db); | ||
688 | let mut validator = UnsafeValidator::new(self.id, infer, sink); | ||
689 | validator.validate_body(db); | ||
690 | } | 681 | } |
691 | } | 682 | } |
692 | 683 | ||
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f74b78b23..d76345525 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs | |||
@@ -18,7 +18,7 @@ use hir_def::{ | |||
18 | }; | 18 | }; |
19 | use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile}; | 19 | use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile}; |
20 | use hir_ty::{ | 20 | use hir_ty::{ |
21 | expr::{record_literal_missing_fields, record_pattern_missing_fields}, | 21 | diagnostics::{record_literal_missing_fields, record_pattern_missing_fields}, |
22 | InferenceResult, Substs, Ty, | 22 | InferenceResult, Substs, Ty, |
23 | }; | 23 | }; |
24 | use ra_syntax::{ | 24 | use ra_syntax::{ |