aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/collector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres/collector.rs')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 3ea8d592c..c5b73cfbe 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -6,7 +6,7 @@ use ra_db::FileId;
6 6
7use crate::{ 7use crate::{
8 Function, Module, Struct, Enum, Const, Static, Trait, TypeAlias, 8 Function, Module, Struct, Enum, Const, Static, Trait, TypeAlias,
9 PersistentHirDatabase, HirFileId, Name, Path, Problem, Crate, 9 DefDatabase, HirFileId, Name, Path, Problem, Crate,
10 KnownName, 10 KnownName,
11 nameres::{Resolution, PerNs, ModuleDef, ReachedFixedPoint, ResolveMode, raw}, 11 nameres::{Resolution, PerNs, ModuleDef, ReachedFixedPoint, ResolveMode, raw},
12 ids::{AstItemDef, LocationCtx, MacroCallLoc, SourceItemId, MacroCallId}, 12 ids::{AstItemDef, LocationCtx, MacroCallLoc, SourceItemId, MacroCallId},
@@ -14,10 +14,7 @@ use crate::{
14 14
15use super::{CrateDefMap, CrateModuleId, ModuleData, CrateMacroId}; 15use super::{CrateDefMap, CrateModuleId, ModuleData, CrateMacroId};
16 16
17pub(super) fn collect_defs( 17pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap {
18 db: &impl PersistentHirDatabase,
19 mut def_map: CrateDefMap,
20) -> CrateDefMap {
21 // populate external prelude 18 // populate external prelude
22 for dep in def_map.krate.dependencies(db) { 19 for dep in def_map.krate.dependencies(db) {
23 log::debug!("crate dep {:?} -> {:?}", dep.name, dep.krate); 20 log::debug!("crate dep {:?} -> {:?}", dep.name, dep.krate);
@@ -57,7 +54,7 @@ struct DefCollector<DB> {
57 54
58impl<'a, DB> DefCollector<&'a DB> 55impl<'a, DB> DefCollector<&'a DB>
59where 56where
60 DB: PersistentHirDatabase, 57 DB: DefDatabase,
61{ 58{
62 fn collect(&mut self) { 59 fn collect(&mut self) {
63 let crate_graph = self.db.crate_graph(); 60 let crate_graph = self.db.crate_graph();
@@ -370,7 +367,7 @@ struct ModCollector<'a, D> {
370 367
371impl<DB> ModCollector<'_, &'_ mut DefCollector<&'_ DB>> 368impl<DB> ModCollector<'_, &'_ mut DefCollector<&'_ DB>>
372where 369where
373 DB: PersistentHirDatabase, 370 DB: DefDatabase,
374{ 371{
375 fn collect(&mut self, items: &[raw::RawItem]) { 372 fn collect(&mut self, items: &[raw::RawItem]) {
376 for item in items { 373 for item in items {
@@ -523,7 +520,7 @@ fn is_macro_rules(path: &Path) -> bool {
523} 520}
524 521
525fn resolve_submodule( 522fn resolve_submodule(
526 db: &impl PersistentHirDatabase, 523 db: &impl DefDatabase,
527 file_id: HirFileId, 524 file_id: HirFileId,
528 name: &Name, 525 name: &Name,
529 is_root: bool, 526 is_root: bool,