diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9222009fec..dbda25d1d9 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -24,12 +24,10 @@ use hir_expand::{ }; use hir_ty::{ autoderef, + diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator}, display::{HirDisplayError, HirFormatter}, - expr::ExprValidator, - method_resolution, - unsafe_validation::UnsafeValidator, - ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, TraitEnvironment, Ty, - TyDefId, TypeCtor, + method_resolution, ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, + TraitEnvironment, Ty, TyDefId, TypeCtor, }; use ra_db::{CrateId, Edition, FileId}; use ra_prof::profile; diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f74b78b237..bfa543e5b6 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::{ - expr::{record_literal_missing_fields, record_pattern_missing_fields}, + diagnostics::expr::{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 5b0dda634f..07c7729b3a 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs @@ -1,4 +1,7 @@ //! FIXME: write short doc here +pub mod expr; +mod match_check; +pub mod unsafe_check; use std::any::Any; diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/diagnostics/expr.rs similarity index 99% rename from crates/ra_hir_ty/src/expr.rs rename to crates/ra_hir_ty/src/diagnostics/expr.rs index d44562b227..51c97f8014 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/diagnostics/expr.rs @@ -10,9 +10,9 @@ use rustc_hash::FxHashSet; use crate::{ db::HirDatabase, diagnostics::{ + match_check::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields, }, - match_checking::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, utils::variant_data, ApplicationTy, InferenceResult, Ty, TypeCtor, }; diff --git a/crates/ra_hir_ty/src/match_checking.rs b/crates/ra_hir_ty/src/diagnostics/match_check.rs similarity index 99% rename from crates/ra_hir_ty/src/match_checking.rs rename to crates/ra_hir_ty/src/diagnostics/match_check.rs index 5495ce284f..722c0e9eea 100644 --- a/crates/ra_hir_ty/src/match_checking.rs +++ b/crates/ra_hir_ty/src/diagnostics/match_check.rs @@ -218,15 +218,16 @@ //! ``` use std::sync::Arc; +use hir_def::{ + adt::VariantData, + body::Body, + expr::{Expr, Literal, Pat, PatId}, + AdtId, EnumVariantId, VariantId, +}; +use ra_arena::Idx; use smallvec::{smallvec, SmallVec}; -use crate::{ - db::HirDatabase, - expr::{Body, Expr, Literal, Pat, PatId}, - ApplicationTy, InferenceResult, Ty, TypeCtor, -}; -use hir_def::{adt::VariantData, AdtId, EnumVariantId, VariantId}; -use ra_arena::Idx; +use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; #[derive(Debug, Clone, Copy)] /// Either a pattern from the source code being analyzed, represented as diff --git a/crates/ra_hir_ty/src/unsafe_validation.rs b/crates/ra_hir_ty/src/diagnostics/unsafe_check.rs similarity index 100% rename from crates/ra_hir_ty/src/unsafe_validation.rs rename to crates/ra_hir_ty/src/diagnostics/unsafe_check.rs diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 2652d200f5..d54568e67a 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -12,15 +12,12 @@ pub mod traits; pub mod method_resolution; mod op; mod lower; -mod match_checking; pub(crate) mod infer; pub(crate) mod utils; pub mod display; pub mod db; pub mod diagnostics; -pub mod expr; -pub mod unsafe_validation; #[cfg(test)] mod tests; diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index dc447955f7..519f43c4e3 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs @@ -14,8 +14,8 @@ use stdx::format_to; use test_utils::extract_annotations; use crate::{ - db::HirDatabase, diagnostics::Diagnostic, expr::ExprValidator, - unsafe_validation::UnsafeValidator, + db::HirDatabase, + diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator, Diagnostic}, }; #[salsa::database(