diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 15 | ||||
-rw-r--r-- | crates/ra_hir/src/source_analyzer.rs | 4 |
3 files changed, 6 insertions, 14 deletions
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index 512676c99..c260bb193 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml | |||
@@ -3,6 +3,7 @@ edition = "2018" | |||
3 | name = "ra_hir" | 3 | name = "ra_hir" |
4 | version = "0.1.0" | 4 | version = "0.1.0" |
5 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
6 | license = "MIT OR Apache-2.0" | ||
6 | 7 | ||
7 | [lib] | 8 | [lib] |
8 | doctest = false | 9 | doctest = false |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9222009fe..42c9ca189 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -25,11 +25,8 @@ use hir_expand::{ | |||
25 | use hir_ty::{ | 25 | use hir_ty::{ |
26 | autoderef, | 26 | autoderef, |
27 | display::{HirDisplayError, HirFormatter}, | 27 | display::{HirDisplayError, HirFormatter}, |
28 | expr::ExprValidator, | 28 | method_resolution, ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, |
29 | method_resolution, | 29 | TraitEnvironment, Ty, TyDefId, TypeCtor, |
30 | unsafe_validation::UnsafeValidator, | ||
31 | ApplicationTy, Canonical, GenericPredicate, InEnvironment, Substs, TraitEnvironment, Ty, | ||
32 | TyDefId, TypeCtor, | ||
33 | }; | 30 | }; |
34 | use ra_db::{CrateId, Edition, FileId}; | 31 | use ra_db::{CrateId, Edition, FileId}; |
35 | use ra_prof::profile; | 32 | use ra_prof::profile; |
@@ -680,13 +677,7 @@ impl Function { | |||
680 | } | 677 | } |
681 | 678 | ||
682 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { | 679 | pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { |
683 | let _p = profile("Function::diagnostics"); | 680 | hir_ty::diagnostics::validate_body(db, self.id.into(), sink) |
684 | let infer = db.infer(self.id.into()); | ||
685 | infer.add_diagnostics(db, self.id, sink); | ||
686 | let mut validator = ExprValidator::new(self.id, infer.clone(), sink); | ||
687 | validator.validate_body(db); | ||
688 | let mut validator = UnsafeValidator::new(self.id, infer, sink); | ||
689 | validator.validate_body(db); | ||
690 | } | 681 | } |
691 | } | 682 | } |
692 | 683 | ||
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f74b78b23..ecb54f653 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs | |||
@@ -18,7 +18,7 @@ use hir_def::{ | |||
18 | }; | 18 | }; |
19 | use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile}; | 19 | use hir_expand::{hygiene::Hygiene, name::AsName, HirFileId, InFile}; |
20 | use hir_ty::{ | 20 | use hir_ty::{ |
21 | expr::{record_literal_missing_fields, record_pattern_missing_fields}, | 21 | diagnostics::{record_literal_missing_fields, record_pattern_missing_fields}, |
22 | InferenceResult, Substs, Ty, | 22 | InferenceResult, Substs, Ty, |
23 | }; | 23 | }; |
24 | use ra_syntax::{ | 24 | use ra_syntax::{ |
@@ -352,7 +352,7 @@ impl SourceAnalyzer { | |||
352 | let macro_call_id = macro_call.as_call_id(db.upcast(), krate, |path| { | 352 | let macro_call_id = macro_call.as_call_id(db.upcast(), krate, |path| { |
353 | self.resolver.resolve_path_as_macro(db.upcast(), &path) | 353 | self.resolver.resolve_path_as_macro(db.upcast(), &path) |
354 | })?; | 354 | })?; |
355 | Some(macro_call_id.as_file()) | 355 | Some(macro_call_id.as_file()).filter(|it| it.expansion_level(db.upcast()) < 64) |
356 | } | 356 | } |
357 | 357 | ||
358 | pub(crate) fn resolve_variant( | 358 | pub(crate) fn resolve_variant( |