diff options
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 13 |
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 | ||
33 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { | 32 | pub(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)] |
94 | struct ImportDirective { | 93 | struct 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 { | |||
110 | struct DefCollector<'a, DB> { | 109 | struct 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 { |