diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-23 14:13:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-23 14:13:50 +0000 |
commit | 1aded342266f18b519666ac512e77b0c211fff5d (patch) | |
tree | 48d78ab757f8df969e334ad9b7f1336f7ecc5f89 /crates/ra_hir_def/src/resolver.rs | |
parent | 87903420968a958e9f420788edb181ddca7b8b31 (diff) | |
parent | ffc2325d194d2523456484a7dec1f175c729c1b5 (diff) |
Merge #2375
2375: Privatise nameres r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/resolver.rs')
-rw-r--r-- | crates/ra_hir_def/src/resolver.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs index 48a836a20..b56de44dd 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/ra_hir_def/src/resolver.rs | |||
@@ -14,11 +14,12 @@ use crate::{ | |||
14 | db::DefDatabase, | 14 | db::DefDatabase, |
15 | expr::{ExprId, PatId}, | 15 | expr::{ExprId, PatId}, |
16 | generics::GenericParams, | 16 | generics::GenericParams, |
17 | nameres::{per_ns::PerNs, CrateDefMap}, | 17 | nameres::CrateDefMap, |
18 | path::{Path, PathKind}, | 18 | path::{Path, PathKind}, |
19 | AdtId, AstItemDef, ConstId, ContainerId, CrateModuleId, DefWithBodyId, EnumId, EnumVariantId, | 19 | per_ns::PerNs, |
20 | FunctionId, GenericDefId, ImplId, Lookup, ModuleDefId, ModuleId, StaticId, StructId, TraitId, | 20 | AdtId, AstItemDef, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, |
21 | TypeAliasId, | 21 | GenericDefId, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, StructId, |
22 | TraitId, TypeAliasId, | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | #[derive(Debug, Clone, Default)] | 25 | #[derive(Debug, Clone, Default)] |
@@ -30,7 +31,7 @@ pub struct Resolver { | |||
30 | #[derive(Debug, Clone)] | 31 | #[derive(Debug, Clone)] |
31 | pub(crate) struct ModuleItemMap { | 32 | pub(crate) struct ModuleItemMap { |
32 | crate_def_map: Arc<CrateDefMap>, | 33 | crate_def_map: Arc<CrateDefMap>, |
33 | module_id: CrateModuleId, | 34 | module_id: LocalModuleId, |
34 | } | 35 | } |
35 | 36 | ||
36 | #[derive(Debug, Clone)] | 37 | #[derive(Debug, Clone)] |
@@ -330,7 +331,7 @@ impl Resolver { | |||
330 | traits | 331 | traits |
331 | } | 332 | } |
332 | 333 | ||
333 | fn module(&self) -> Option<(&CrateDefMap, CrateModuleId)> { | 334 | fn module(&self) -> Option<(&CrateDefMap, LocalModuleId)> { |
334 | self.scopes.iter().rev().find_map(|scope| match scope { | 335 | self.scopes.iter().rev().find_map(|scope| match scope { |
335 | Scope::ModuleScope(m) => Some((&*m.crate_def_map, m.module_id)), | 336 | Scope::ModuleScope(m) => Some((&*m.crate_def_map, m.module_id)), |
336 | 337 | ||
@@ -466,7 +467,7 @@ impl Resolver { | |||
466 | fn push_module_scope( | 467 | fn push_module_scope( |
467 | self, | 468 | self, |
468 | crate_def_map: Arc<CrateDefMap>, | 469 | crate_def_map: Arc<CrateDefMap>, |
469 | module_id: CrateModuleId, | 470 | module_id: LocalModuleId, |
470 | ) -> Resolver { | 471 | ) -> Resolver { |
471 | self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id })) | 472 | self.push_scope(Scope::ModuleScope(ModuleItemMap { crate_def_map, module_id })) |
472 | } | 473 | } |