mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Consolidate hir diagnostics code in one place
This commit is contained in:
parent
c6f3540121
commit
1fdbf81181
8 changed files with 18 additions and 19 deletions
|
@ -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;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
//! FIXME: write short doc here
|
||||
pub mod expr;
|
||||
mod match_check;
|
||||
pub mod unsafe_check;
|
||||
|
||||
use std::any::Any;
|
||||
|
||||
|
|
|
@ -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,
|
||||
};
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue