diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-23 11:50:30 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-23 11:50:30 +0000 |
commit | 102f1984c662544d16441d437e5b0883502d49d1 (patch) | |
tree | 9fbf1b22c02412f15ad4ddb8fcbc405ce8d33795 /crates/ra_hir_def/src/nameres | |
parent | ee300085c016a5b24ff61e0a1406857d4e638618 (diff) | |
parent | 32658a73b4c9078421a1cab92ec459bb5b7236f5 (diff) |
Merge #2372
2372: Note that debugging infra is broken r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/mod_resolution.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/path_resolution.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/raw.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests.rs | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 7902293e8..1894b072a 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -13,7 +13,7 @@ use test_utils::tested_by; | |||
13 | 13 | ||
14 | use crate::{ | 14 | use crate::{ |
15 | attr::Attrs, | 15 | attr::Attrs, |
16 | db::DefDatabase2, | 16 | db::DefDatabase, |
17 | nameres::{ | 17 | nameres::{ |
18 | diagnostics::DefDiagnostic, mod_resolution::ModDir, path_resolution::ReachedFixedPoint, | 18 | diagnostics::DefDiagnostic, mod_resolution::ModDir, path_resolution::ReachedFixedPoint, |
19 | per_ns::PerNs, raw, CrateDefMap, ModuleData, Resolution, ResolveMode, | 19 | per_ns::PerNs, raw, CrateDefMap, ModuleData, Resolution, ResolveMode, |
@@ -24,7 +24,7 @@ use crate::{ | |||
24 | StructOrUnionId, TraitId, TypeAliasLoc, UnionId, | 24 | StructOrUnionId, TraitId, TypeAliasLoc, UnionId, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { | 27 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { |
28 | let crate_graph = db.crate_graph(); | 28 | let crate_graph = db.crate_graph(); |
29 | 29 | ||
30 | // populate external prelude | 30 | // populate external prelude |
@@ -108,7 +108,7 @@ struct DefCollector<'a, DB> { | |||
108 | 108 | ||
109 | impl<DB> DefCollector<'_, DB> | 109 | impl<DB> DefCollector<'_, DB> |
110 | where | 110 | where |
111 | DB: DefDatabase2, | 111 | DB: DefDatabase, |
112 | { | 112 | { |
113 | fn collect(&mut self) { | 113 | fn collect(&mut self) { |
114 | let crate_graph = self.db.crate_graph(); | 114 | let crate_graph = self.db.crate_graph(); |
@@ -530,7 +530,7 @@ struct ModCollector<'a, D> { | |||
530 | 530 | ||
531 | impl<DB> ModCollector<'_, &'_ mut DefCollector<'_, DB>> | 531 | impl<DB> ModCollector<'_, &'_ mut DefCollector<'_, DB>> |
532 | where | 532 | where |
533 | DB: DefDatabase2, | 533 | DB: DefDatabase, |
534 | { | 534 | { |
535 | fn collect(&mut self, items: &[raw::RawItem]) { | 535 | fn collect(&mut self, items: &[raw::RawItem]) { |
536 | // Note: don't assert that inserted value is fresh: it's simply not true | 536 | // Note: don't assert that inserted value is fresh: it's simply not true |
@@ -798,12 +798,12 @@ mod tests { | |||
798 | use ra_db::{fixture::WithFixture, SourceDatabase}; | 798 | use ra_db::{fixture::WithFixture, SourceDatabase}; |
799 | use rustc_hash::FxHashSet; | 799 | use rustc_hash::FxHashSet; |
800 | 800 | ||
801 | use crate::{db::DefDatabase2, test_db::TestDB}; | 801 | use crate::{db::DefDatabase, test_db::TestDB}; |
802 | 802 | ||
803 | use super::*; | 803 | use super::*; |
804 | 804 | ||
805 | fn do_collect_defs( | 805 | fn do_collect_defs( |
806 | db: &impl DefDatabase2, | 806 | db: &impl DefDatabase, |
807 | def_map: CrateDefMap, | 807 | def_map: CrateDefMap, |
808 | monitor: MacroStackMonitor, | 808 | monitor: MacroStackMonitor, |
809 | ) -> CrateDefMap { | 809 | ) -> CrateDefMap { |
diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs index b3b1379d0..14fb8ba3a 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs | |||
@@ -3,7 +3,7 @@ use hir_expand::name::Name; | |||
3 | use ra_db::{FileId, RelativePathBuf}; | 3 | use ra_db::{FileId, RelativePathBuf}; |
4 | use ra_syntax::SmolStr; | 4 | use ra_syntax::SmolStr; |
5 | 5 | ||
6 | use crate::{db::DefDatabase2, HirFileId}; | 6 | use crate::{db::DefDatabase, HirFileId}; |
7 | 7 | ||
8 | #[derive(Clone, Debug)] | 8 | #[derive(Clone, Debug)] |
9 | pub(super) struct ModDir { | 9 | pub(super) struct ModDir { |
@@ -40,7 +40,7 @@ impl ModDir { | |||
40 | 40 | ||
41 | pub(super) fn resolve_declaration( | 41 | pub(super) fn resolve_declaration( |
42 | &self, | 42 | &self, |
43 | db: &impl DefDatabase2, | 43 | db: &impl DefDatabase, |
44 | file_id: HirFileId, | 44 | file_id: HirFileId, |
45 | name: &Name, | 45 | name: &Name, |
46 | attr_path: Option<&SmolStr>, | 46 | attr_path: Option<&SmolStr>, |
diff --git a/crates/ra_hir_def/src/nameres/path_resolution.rs b/crates/ra_hir_def/src/nameres/path_resolution.rs index 95692f826..102009ac7 100644 --- a/crates/ra_hir_def/src/nameres/path_resolution.rs +++ b/crates/ra_hir_def/src/nameres/path_resolution.rs | |||
@@ -15,7 +15,7 @@ use ra_db::Edition; | |||
15 | use test_utils::tested_by; | 15 | use test_utils::tested_by; |
16 | 16 | ||
17 | use crate::{ | 17 | use crate::{ |
18 | db::DefDatabase2, | 18 | db::DefDatabase, |
19 | nameres::{per_ns::PerNs, CrateDefMap}, | 19 | nameres::{per_ns::PerNs, CrateDefMap}, |
20 | path::{Path, PathKind}, | 20 | path::{Path, PathKind}, |
21 | AdtId, CrateModuleId, EnumVariantId, ModuleDefId, ModuleId, | 21 | AdtId, CrateModuleId, EnumVariantId, ModuleDefId, ModuleId, |
@@ -63,7 +63,7 @@ impl CrateDefMap { | |||
63 | // the result. | 63 | // the result. |
64 | pub(super) fn resolve_path_fp_with_macro( | 64 | pub(super) fn resolve_path_fp_with_macro( |
65 | &self, | 65 | &self, |
66 | db: &impl DefDatabase2, | 66 | db: &impl DefDatabase, |
67 | mode: ResolveMode, | 67 | mode: ResolveMode, |
68 | original_module: CrateModuleId, | 68 | original_module: CrateModuleId, |
69 | path: &Path, | 69 | path: &Path, |
@@ -216,7 +216,7 @@ impl CrateDefMap { | |||
216 | 216 | ||
217 | fn resolve_name_in_module( | 217 | fn resolve_name_in_module( |
218 | &self, | 218 | &self, |
219 | db: &impl DefDatabase2, | 219 | db: &impl DefDatabase, |
220 | module: CrateModuleId, | 220 | module: CrateModuleId, |
221 | name: &Name, | 221 | name: &Name, |
222 | ) -> PerNs { | 222 | ) -> PerNs { |
@@ -243,7 +243,7 @@ impl CrateDefMap { | |||
243 | from_crate_root.or(from_extern_prelude) | 243 | from_crate_root.or(from_extern_prelude) |
244 | } | 244 | } |
245 | 245 | ||
246 | fn resolve_in_prelude(&self, db: &impl DefDatabase2, name: &Name) -> PerNs { | 246 | fn resolve_in_prelude(&self, db: &impl DefDatabase, name: &Name) -> PerNs { |
247 | if let Some(prelude) = self.prelude { | 247 | if let Some(prelude) = self.prelude { |
248 | let keep; | 248 | let keep; |
249 | let def_map = if prelude.krate == self.krate { | 249 | let def_map = if prelude.krate == self.krate { |
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs index 55a9634f8..7618cb059 100644 --- a/crates/ra_hir_def/src/nameres/raw.rs +++ b/crates/ra_hir_def/src/nameres/raw.rs | |||
@@ -18,7 +18,7 @@ use test_utils::tested_by; | |||
18 | 18 | ||
19 | use crate::{ | 19 | use crate::{ |
20 | attr::{Attr, Attrs}, | 20 | attr::{Attr, Attrs}, |
21 | db::DefDatabase2, | 21 | db::DefDatabase, |
22 | path::Path, | 22 | path::Path, |
23 | FileAstId, HirFileId, ModuleSource, Source, | 23 | FileAstId, HirFileId, ModuleSource, Source, |
24 | }; | 24 | }; |
@@ -67,14 +67,14 @@ impl ImportSourceMap { | |||
67 | 67 | ||
68 | impl RawItems { | 68 | impl RawItems { |
69 | pub(crate) fn raw_items_query( | 69 | pub(crate) fn raw_items_query( |
70 | db: &(impl DefDatabase2 + AstDatabase), | 70 | db: &(impl DefDatabase + AstDatabase), |
71 | file_id: HirFileId, | 71 | file_id: HirFileId, |
72 | ) -> Arc<RawItems> { | 72 | ) -> Arc<RawItems> { |
73 | db.raw_items_with_source_map(file_id).0 | 73 | db.raw_items_with_source_map(file_id).0 |
74 | } | 74 | } |
75 | 75 | ||
76 | pub(crate) fn raw_items_with_source_map_query( | 76 | pub(crate) fn raw_items_with_source_map_query( |
77 | db: &(impl DefDatabase2 + AstDatabase), | 77 | db: &(impl DefDatabase + AstDatabase), |
78 | file_id: HirFileId, | 78 | file_id: HirFileId, |
79 | ) -> (Arc<RawItems>, Arc<ImportSourceMap>) { | 79 | ) -> (Arc<RawItems>, Arc<ImportSourceMap>) { |
80 | let mut collector = RawItemsCollector { | 80 | let mut collector = RawItemsCollector { |
diff --git a/crates/ra_hir_def/src/nameres/tests.rs b/crates/ra_hir_def/src/nameres/tests.rs index 256f7d4be..b5053ba20 100644 --- a/crates/ra_hir_def/src/nameres/tests.rs +++ b/crates/ra_hir_def/src/nameres/tests.rs | |||
@@ -10,7 +10,7 @@ use insta::assert_snapshot; | |||
10 | use ra_db::{fixture::WithFixture, SourceDatabase}; | 10 | use ra_db::{fixture::WithFixture, SourceDatabase}; |
11 | use test_utils::covers; | 11 | use test_utils::covers; |
12 | 12 | ||
13 | use crate::{db::DefDatabase2, nameres::*, test_db::TestDB, CrateModuleId}; | 13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB, CrateModuleId}; |
14 | 14 | ||
15 | fn def_map(fixtute: &str) -> String { | 15 | fn def_map(fixtute: &str) -> String { |
16 | let dm = compute_crate_def_map(fixtute); | 16 | let dm = compute_crate_def_map(fixtute); |