aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres/collector.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-21 16:34:28 +0000
committerAleksey Kladov <[email protected]>2019-12-21 16:34:28 +0000
commit1a8f2aa024c6f1a5e9704c9cbd2e5a020debe2c2 (patch)
tree2d432efaf61acd53adc8cf0f78f4ed60f1fa758c /crates/ra_hir_def/src/nameres/collector.rs
parent02f79e37ca1c4a617a46b85bf897dffbf4abed9e (diff)
Move LocalImportId
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs
index c2db5472b..2b194f488 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/ra_hir_def/src/nameres/collector.rs
@@ -26,8 +26,7 @@ use crate::{
26 path::{ModPath, PathKind}, 26 path::{ModPath, PathKind},
27 per_ns::PerNs, 27 per_ns::PerNs,
28 AdtId, AstId, ConstLoc, ContainerId, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, 28 AdtId, AstId, ConstLoc, ContainerId, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern,
29 LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, 29 LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, TypeAliasLoc, UnionLoc,
30 TypeAliasLoc, UnionLoc,
31}; 30};
32 31
33pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { 32pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap {
@@ -93,7 +92,7 @@ impl PartialResolvedImport {
93#[derive(Clone, Debug, Eq, PartialEq)] 92#[derive(Clone, Debug, Eq, PartialEq)]
94struct ImportDirective { 93struct ImportDirective {
95 module_id: LocalModuleId, 94 module_id: LocalModuleId,
96 import_id: LocalImportId, 95 import_id: raw::Import,
97 import: raw::ImportData, 96 import: raw::ImportData,
98 status: PartialResolvedImport, 97 status: PartialResolvedImport,
99} 98}
@@ -110,7 +109,7 @@ struct MacroDirective {
110struct DefCollector<'a, DB> { 109struct DefCollector<'a, DB> {
111 db: &'a DB, 110 db: &'a DB,
112 def_map: CrateDefMap, 111 def_map: CrateDefMap,
113 glob_imports: FxHashMap<LocalModuleId, Vec<(LocalModuleId, LocalImportId)>>, 112 glob_imports: FxHashMap<LocalModuleId, Vec<(LocalModuleId, raw::Import)>>,
114 unresolved_imports: Vec<ImportDirective>, 113 unresolved_imports: Vec<ImportDirective>,
115 resolved_imports: Vec<ImportDirective>, 114 resolved_imports: Vec<ImportDirective>,
116 unexpanded_macros: Vec<MacroDirective>, 115 unexpanded_macros: Vec<MacroDirective>,
@@ -442,7 +441,7 @@ where
442 fn update( 441 fn update(
443 &mut self, 442 &mut self,
444 module_id: LocalModuleId, 443 module_id: LocalModuleId,
445 import: Option<LocalImportId>, 444 import: Option<raw::Import>,
446 resolutions: &[(Name, Resolution)], 445 resolutions: &[(Name, Resolution)],
447 ) { 446 ) {
448 self.update_recursive(module_id, import, resolutions, 0) 447 self.update_recursive(module_id, import, resolutions, 0)
@@ -451,7 +450,7 @@ where
451 fn update_recursive( 450 fn update_recursive(
452 &mut self, 451 &mut self,
453 module_id: LocalModuleId, 452 module_id: LocalModuleId,
454 import: Option<LocalImportId>, 453 import: Option<raw::Import>,
455 resolutions: &[(Name, Resolution)], 454 resolutions: &[(Name, Resolution)],
456 depth: usize, 455 depth: usize,
457 ) { 456 ) {
@@ -462,7 +461,7 @@ where
462 let scope = &mut self.def_map.modules[module_id].scope; 461 let scope = &mut self.def_map.modules[module_id].scope;
463 let mut changed = false; 462 let mut changed = false;
464 for (name, res) in resolutions { 463 for (name, res) in resolutions {
465 changed |= scope.push_res(name.clone(), res, import); 464 changed |= scope.push_res(name.clone(), res, import.is_some());
466 } 465 }
467 466
468 if !changed { 467 if !changed {