diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index bfa543e5b6..d76345525f 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -18,7 +18,7 @@ use hir_def::{ }; use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile}; use hir_ty::{ - diagnostics::expr::{record_literal_missing_fields, record_pattern_missing_fields}, + diagnostics::{record_literal_missing_fields, record_pattern_missing_fields}, InferenceResult, Substs, Ty, }; use ra_syntax::{ diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index d9c2b1214f..3623b8569e 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs @@ -1,20 +1,21 @@ //! FIXME: write short doc here -pub mod expr; +mod expr; mod match_check; -pub mod unsafe_check; +mod unsafe_check; use std::any::Any; +use hir_def::DefWithBodyId; +use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink}; use hir_expand::{db::AstDatabase, name::Name, HirFileId, InFile}; use ra_prof::profile; use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; use stdx::format_to; -pub use hir_def::{diagnostics::UnresolvedModule, expr::MatchArm, path::Path, DefWithBodyId}; -pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink}; - use crate::db::HirDatabase; +pub use crate::diagnostics::expr::{record_literal_missing_fields, record_pattern_missing_fields}; + pub fn validate_body(db: &dyn HirDatabase, owner: DefWithBodyId, sink: &mut DiagnosticSink<'_>) { let _p = profile("validate_body"); let infer = db.infer(owner); diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index daf2b909eb..ddafd0ea13 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs @@ -6,14 +6,17 @@ use std::{ }; use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId, ModuleId}; -use hir_expand::{db::AstDatabase, diagnostics::DiagnosticSink}; +use hir_expand::{ + db::AstDatabase, + diagnostics::{Diagnostic, DiagnosticSink}, +}; use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast}; use ra_syntax::TextRange; use rustc_hash::{FxHashMap, FxHashSet}; use stdx::format_to; use test_utils::extract_annotations; -use crate::diagnostics::{validate_body, Diagnostic}; +use crate::diagnostics::validate_body; #[salsa::database( ra_db::SourceDatabaseExtStorage,