From 19450534cf308eff30ea7de1a40ab77dca4e6014 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 Jul 2020 10:28:55 +0200 Subject: Cleanup hir diagnostics API --- crates/ra_hir/src/code_model.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index dbda25d1d..42c9ca189 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -24,7 +24,6 @@ use hir_expand::{ }; use hir_ty::{ autoderef, - diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator}, display::{HirDisplayError, HirFormatter}, method_resolution, ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor, @@ -678,13 +677,7 @@ impl Function { } pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { - let _p = profile("Function::diagnostics"); - let infer = db.infer(self.id.into()); - infer.add_diagnostics(db, self.id, sink); - let mut validator = ExprValidator::new(self.id, infer.clone(), sink); - validator.validate_body(db); - let mut validator = UnsafeValidator::new(self.id, infer, sink); - validator.validate_body(db); + hir_ty::diagnostics::validate_body(db, self.id.into(), sink) } } -- cgit v1.2.3