mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +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::{
|
use hir_ty::{
|
||||||
autoderef,
|
autoderef,
|
||||||
|
diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator},
|
||||||
display::{HirDisplayError, HirFormatter},
|
display::{HirDisplayError, HirFormatter},
|
||||||
expr::ExprValidator,
|
method_resolution, ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs,
|
||||||
method_resolution,
|
TraitEnvironment, Ty, TyDefId, TypeCtor,
|
||||||
unsafe_validation::UnsafeValidator,
|
|
||||||
ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, TraitEnvironment, Ty,
|
|
||||||
TyDefId, TypeCtor,
|
|
||||||
};
|
};
|
||||||
use ra_db::{CrateId, Edition, FileId};
|
use ra_db::{CrateId, Edition, FileId};
|
||||||
use ra_prof::profile;
|
use ra_prof::profile;
|
||||||
|
|
|
@ -18,7 +18,7 @@ use hir_def::{
|
||||||
};
|
};
|
||||||
use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile};
|
use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile};
|
||||||
use hir_ty::{
|
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,
|
InferenceResult, Substs, Ty,
|
||||||
};
|
};
|
||||||
use ra_syntax::{
|
use ra_syntax::{
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
pub mod expr;
|
||||||
|
mod match_check;
|
||||||
|
pub mod unsafe_check;
|
||||||
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@ use rustc_hash::FxHashSet;
|
||||||
use crate::{
|
use crate::{
|
||||||
db::HirDatabase,
|
db::HirDatabase,
|
||||||
diagnostics::{
|
diagnostics::{
|
||||||
|
match_check::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness},
|
||||||
MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields,
|
MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields,
|
||||||
},
|
},
|
||||||
match_checking::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness},
|
|
||||||
utils::variant_data,
|
utils::variant_data,
|
||||||
ApplicationTy, InferenceResult, Ty, TypeCtor,
|
ApplicationTy, InferenceResult, Ty, TypeCtor,
|
||||||
};
|
};
|
|
@ -218,15 +218,16 @@
|
||||||
//! ```
|
//! ```
|
||||||
use std::sync::Arc;
|
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 smallvec::{smallvec, SmallVec};
|
||||||
|
|
||||||
use crate::{
|
use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor};
|
||||||
db::HirDatabase,
|
|
||||||
expr::{Body, Expr, Literal, Pat, PatId},
|
|
||||||
ApplicationTy, InferenceResult, Ty, TypeCtor,
|
|
||||||
};
|
|
||||||
use hir_def::{adt::VariantData, AdtId, EnumVariantId, VariantId};
|
|
||||||
use ra_arena::Idx;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
/// Either a pattern from the source code being analyzed, represented as
|
/// Either a pattern from the source code being analyzed, represented as
|
|
@ -12,15 +12,12 @@ pub mod traits;
|
||||||
pub mod method_resolution;
|
pub mod method_resolution;
|
||||||
mod op;
|
mod op;
|
||||||
mod lower;
|
mod lower;
|
||||||
mod match_checking;
|
|
||||||
pub(crate) mod infer;
|
pub(crate) mod infer;
|
||||||
pub(crate) mod utils;
|
pub(crate) mod utils;
|
||||||
|
|
||||||
pub mod display;
|
pub mod display;
|
||||||
pub mod db;
|
pub mod db;
|
||||||
pub mod diagnostics;
|
pub mod diagnostics;
|
||||||
pub mod expr;
|
|
||||||
pub mod unsafe_validation;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
|
@ -14,8 +14,8 @@ use stdx::format_to;
|
||||||
use test_utils::extract_annotations;
|
use test_utils::extract_annotations;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::HirDatabase, diagnostics::Diagnostic, expr::ExprValidator,
|
db::HirDatabase,
|
||||||
unsafe_validation::UnsafeValidator,
|
diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator, Diagnostic},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[salsa::database(
|
#[salsa::database(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue