From b2390f10fa55d983cd4439f1bfb07a3fa9a63e75 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 Jul 2020 10:52:18 +0200 Subject: Cleanup visibility --- crates/ra_hir/src/source_analyzer.rs | 2 +- crates/ra_hir_ty/src/diagnostics.rs | 11 ++++++----- crates/ra_hir_ty/src/test_db.rs | 7 +++++-- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index bfa543e5b..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::{ }; 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 d9c2b1214..3623b8569 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 daf2b909e..ddafd0ea1 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, -- cgit v1.2.3