diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 15 |
1 files changed, 3 insertions, 12 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 | ||