aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/resolver.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/resolver.rs')
-rw-r--r--crates/hir_def/src/resolver.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index 85ddc2c47..e7e92c72d 100644
--- a/crates/hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -16,7 +16,7 @@ use crate::{
16 expr::{ExprId, PatId}, 16 expr::{ExprId, PatId},
17 generics::GenericParams, 17 generics::GenericParams,
18 item_scope::{BuiltinShadowMode, BUILTIN_SCOPE}, 18 item_scope::{BuiltinShadowMode, BUILTIN_SCOPE},
19 nameres::CrateDefMap, 19 nameres::DefMap,
20 path::{ModPath, PathKind}, 20 path::{ModPath, PathKind},
21 per_ns::PerNs, 21 per_ns::PerNs,
22 visibility::{RawVisibility, Visibility}, 22 visibility::{RawVisibility, Visibility},
@@ -34,7 +34,7 @@ pub struct Resolver {
34// FIXME how to store these best 34// FIXME how to store these best
35#[derive(Debug, Clone)] 35#[derive(Debug, Clone)]
36struct ModuleItemMap { 36struct ModuleItemMap {
37 crate_def_map: Arc<CrateDefMap>, 37 crate_def_map: Arc<DefMap>,
38 module_id: LocalModuleId, 38 module_id: LocalModuleId,
39} 39}
40 40
@@ -425,7 +425,7 @@ impl Resolver {
425 traits 425 traits
426 } 426 }
427 427
428 fn module_scope(&self) -> Option<(&CrateDefMap, LocalModuleId)> { 428 fn module_scope(&self) -> Option<(&DefMap, LocalModuleId)> {
429 self.scopes.iter().rev().find_map(|scope| match scope { 429 self.scopes.iter().rev().find_map(|scope| match scope {
430 Scope::ModuleScope(m) => Some((&*m.crate_def_map, m.module_id)), 430 Scope::ModuleScope(m) => Some((&*m.crate_def_map, m.module_id)),
431 431
@@ -588,11 +588,7 @@ impl Resolver {
588 self.push_scope(Scope::ImplDefScope(impl_def)) 588 self.push_scope(Scope::ImplDefScope(impl_def))
589 } 589 }
590 590
591 fn push_module_scope( 591 fn push_module_scope(self, crate_def_map: Arc<DefMap>, module_id: LocalModuleId) -> Resolver {
592 self,
593 crate_def_map: Arc<CrateDefMap>,
594 module_id: LocalModuleId,
595 ) -> Resolver {
596 self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id })) 592 self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id }))
597 } 593 }
598 594