diff options
Diffstat (limited to 'crates/ra_hir_ty/src/test_db.rs')
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index dc447955f..ddafd0ea1 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs | |||
@@ -6,17 +6,17 @@ use std::{ | |||
6 | }; | 6 | }; |
7 | 7 | ||
8 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId, ModuleId}; | 8 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId, ModuleId}; |
9 | use hir_expand::{db::AstDatabase, diagnostics::DiagnosticSink}; | 9 | use hir_expand::{ |
10 | db::AstDatabase, | ||
11 | diagnostics::{Diagnostic, DiagnosticSink}, | ||
12 | }; | ||
10 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast}; | 13 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast}; |
11 | use ra_syntax::TextRange; | 14 | use ra_syntax::TextRange; |
12 | use rustc_hash::{FxHashMap, FxHashSet}; | 15 | use rustc_hash::{FxHashMap, FxHashSet}; |
13 | use stdx::format_to; | 16 | use stdx::format_to; |
14 | use test_utils::extract_annotations; | 17 | use test_utils::extract_annotations; |
15 | 18 | ||
16 | use crate::{ | 19 | use crate::diagnostics::validate_body; |
17 | db::HirDatabase, diagnostics::Diagnostic, expr::ExprValidator, | ||
18 | unsafe_validation::UnsafeValidator, | ||
19 | }; | ||
20 | 20 | ||
21 | #[salsa::database( | 21 | #[salsa::database( |
22 | ra_db::SourceDatabaseExtStorage, | 22 | ra_db::SourceDatabaseExtStorage, |
@@ -118,13 +118,8 @@ impl TestDB { | |||
118 | } | 118 | } |
119 | 119 | ||
120 | for f in fns { | 120 | for f in fns { |
121 | let infer = self.infer(f.into()); | ||
122 | let mut sink = DiagnosticSink::new(&mut cb); | 121 | let mut sink = DiagnosticSink::new(&mut cb); |
123 | infer.add_diagnostics(self, f, &mut sink); | 122 | validate_body(self, f.into(), &mut sink); |
124 | let mut validator = ExprValidator::new(f, infer.clone(), &mut sink); | ||
125 | validator.validate_body(self); | ||
126 | let mut validator = UnsafeValidator::new(f, infer, &mut sink); | ||
127 | validator.validate_body(self); | ||
128 | } | 123 | } |
129 | } | 124 | } |
130 | } | 125 | } |