diff options
author | Aleksey Kladov <[email protected]> | 2020-07-14 09:18:08 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-14 09:18:08 +0100 |
commit | 1fdbf81181356854b692fe0407bac75aba6ea942 (patch) | |
tree | 8118892265a4be2ff71da372061fbffc3c9ffb3d /crates/ra_hir_ty | |
parent | c6f35401219e32c7d62e106a45637e7f5304723c (diff) |
Consolidate hir diagnostics code in one place
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/expr.rs (renamed from crates/ra_hir_ty/src/expr.rs) | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/match_check.rs (renamed from crates/ra_hir_ty/src/match_checking.rs) | 15 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/unsafe_check.rs (renamed from crates/ra_hir_ty/src/unsafe_validation.rs) | 0 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 4 |
6 files changed, 14 insertions, 13 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 5b0dda634..07c7729b3 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -1,4 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | pub mod expr; | ||
3 | mod match_check; | ||
4 | pub mod unsafe_check; | ||
2 | 5 | ||
3 | use std::any::Any; | 6 | use std::any::Any; |
4 | 7 | ||
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/diagnostics/expr.rs index d44562b22..51c97f801 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; | |||
10 | use crate::{ | 10 | use crate::{ |
11 | db::HirDatabase, | 11 | db::HirDatabase, |
12 | diagnostics::{ | 12 | diagnostics::{ |
13 | match_check::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, | ||
13 | MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields, | 14 | MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields, |
14 | }, | 15 | }, |
15 | match_checking::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, | ||
16 | utils::variant_data, | 16 | utils::variant_data, |
17 | ApplicationTy, InferenceResult, Ty, TypeCtor, | 17 | ApplicationTy, InferenceResult, Ty, TypeCtor, |
18 | }; | 18 | }; |
diff --git a/crates/ra_hir_ty/src/match_checking.rs b/crates/ra_hir_ty/src/diagnostics/match_check.rs index 5495ce284..722c0e9ee 100644 --- a/crates/ra_hir_ty/src/match_checking.rs +++ b/crates/ra_hir_ty/src/diagnostics/match_check.rs | |||
@@ -218,15 +218,16 @@ | |||
218 | //! ``` | 218 | //! ``` |
219 | use std::sync::Arc; | 219 | use std::sync::Arc; |
220 | 220 | ||
221 | use smallvec::{smallvec, SmallVec}; | 221 | use hir_def::{ |
222 | 222 | adt::VariantData, | |
223 | use crate::{ | 223 | body::Body, |
224 | db::HirDatabase, | 224 | expr::{Expr, Literal, Pat, PatId}, |
225 | expr::{Body, Expr, Literal, Pat, PatId}, | 225 | AdtId, EnumVariantId, VariantId, |
226 | ApplicationTy, InferenceResult, Ty, TypeCtor, | ||
227 | }; | 226 | }; |
228 | use hir_def::{adt::VariantData, AdtId, EnumVariantId, VariantId}; | ||
229 | use ra_arena::Idx; | 227 | use ra_arena::Idx; |
228 | use smallvec::{smallvec, SmallVec}; | ||
229 | |||
230 | use crate::{db::HirDatabase, ApplicationTy, InferenceResult, Ty, TypeCtor}; | ||
230 | 231 | ||
231 | #[derive(Debug, Clone, Copy)] | 232 | #[derive(Debug, Clone, Copy)] |
232 | /// Either a pattern from the source code being analyzed, represented as | 233 | /// 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 index c512c4f8e..c512c4f8e 100644 --- a/crates/ra_hir_ty/src/unsafe_validation.rs +++ b/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 2652d200f..d54568e67 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -12,15 +12,12 @@ pub mod traits; | |||
12 | pub mod method_resolution; | 12 | pub mod method_resolution; |
13 | mod op; | 13 | mod op; |
14 | mod lower; | 14 | mod lower; |
15 | mod match_checking; | ||
16 | pub(crate) mod infer; | 15 | pub(crate) mod infer; |
17 | pub(crate) mod utils; | 16 | pub(crate) mod utils; |
18 | 17 | ||
19 | pub mod display; | 18 | pub mod display; |
20 | pub mod db; | 19 | pub mod db; |
21 | pub mod diagnostics; | 20 | pub mod diagnostics; |
22 | pub mod expr; | ||
23 | pub mod unsafe_validation; | ||
24 | 21 | ||
25 | #[cfg(test)] | 22 | #[cfg(test)] |
26 | mod tests; | 23 | mod tests; |
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index dc447955f..519f43c4e 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; | |||
14 | use test_utils::extract_annotations; | 14 | use test_utils::extract_annotations; |
15 | 15 | ||
16 | use crate::{ | 16 | use crate::{ |
17 | db::HirDatabase, diagnostics::Diagnostic, expr::ExprValidator, | 17 | db::HirDatabase, |
18 | unsafe_validation::UnsafeValidator, | 18 | diagnostics::{expr::ExprValidator, unsafe_check::UnsafeValidator, Diagnostic}, |
19 | }; | 19 | }; |
20 | 20 | ||
21 | #[salsa::database( | 21 | #[salsa::database( |