diff options
author | Aleksey Kladov <[email protected]> | 2019-12-20 10:59:50 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-20 11:00:05 +0000 |
commit | 8fc20b65035d93bcc1b3a89127916bd165a8d938 (patch) | |
tree | 7e95963bb359eb6eeda8f6aba564fd3eaf7030d2 /crates/ra_hir_def/src | |
parent | 67c2aea182c375108ebb8b923f5679e4f7fef1df (diff) |
Rename ContainerId -> AssocContainerId
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 18 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir_def/src/resolver.rs | 16 |
5 files changed, 29 insertions, 29 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 17efa10e2..afd5231cc 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -25,7 +25,7 @@ use crate::{ | |||
25 | path::GenericArgs, | 25 | path::GenericArgs, |
26 | path::Path, | 26 | path::Path, |
27 | type_ref::{Mutability, TypeRef}, | 27 | type_ref::{Mutability, TypeRef}, |
28 | ContainerId, DefWithBodyId, FunctionLoc, Intern, | 28 | AssocContainerId, DefWithBodyId, FunctionLoc, Intern, |
29 | }; | 29 | }; |
30 | 30 | ||
31 | pub(super) fn lower( | 31 | pub(super) fn lower( |
@@ -490,7 +490,7 @@ where | |||
490 | } | 490 | } |
491 | 491 | ||
492 | fn collect_block_items(&mut self, block: &ast::Block) { | 492 | fn collect_block_items(&mut self, block: &ast::Block) { |
493 | let container = ContainerId::DefWithBodyId(self.def); | 493 | let container = AssocContainerId::DefWithBodyId(self.def); |
494 | for item in block.items() { | 494 | for item in block.items() { |
495 | match item { | 495 | match item { |
496 | ast::ModuleItem::FnDef(def) => { | 496 | ast::ModuleItem::FnDef(def) => { |
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 4f4ef57cc..14e86936b 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -12,8 +12,8 @@ use crate::{ | |||
12 | db::DefDatabase, | 12 | db::DefDatabase, |
13 | src::HasSource, | 13 | src::HasSource, |
14 | type_ref::{Mutability, TypeRef}, | 14 | type_ref::{Mutability, TypeRef}, |
15 | AssocItemId, ConstId, ConstLoc, ContainerId, FunctionId, FunctionLoc, ImplId, Intern, Lookup, | 15 | AssocContainerId, AssocItemId, ConstId, ConstLoc, FunctionId, FunctionLoc, ImplId, Intern, |
16 | StaticId, TraitId, TypeAliasId, TypeAliasLoc, | 16 | Lookup, StaticId, TraitId, TypeAliasId, TypeAliasLoc, |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #[derive(Debug, Clone, PartialEq, Eq)] | 19 | #[derive(Debug, Clone, PartialEq, Eq)] |
@@ -99,7 +99,7 @@ impl TraitData { | |||
99 | let auto = src.value.is_auto(); | 99 | let auto = src.value.is_auto(); |
100 | let ast_id_map = db.ast_id_map(src.file_id); | 100 | let ast_id_map = db.ast_id_map(src.file_id); |
101 | 101 | ||
102 | let container = ContainerId::TraitId(tr); | 102 | let container = AssocContainerId::TraitId(tr); |
103 | let items = if let Some(item_list) = src.value.item_list() { | 103 | let items = if let Some(item_list) = src.value.item_list() { |
104 | item_list | 104 | item_list |
105 | .impl_items() | 105 | .impl_items() |
@@ -180,7 +180,7 @@ impl ImplData { | |||
180 | .map(|item_node| match item_node { | 180 | .map(|item_node| match item_node { |
181 | ast::ImplItem::FnDef(it) => { | 181 | ast::ImplItem::FnDef(it) => { |
182 | let def = FunctionLoc { | 182 | let def = FunctionLoc { |
183 | container: ContainerId::ImplId(id), | 183 | container: AssocContainerId::ImplId(id), |
184 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 184 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
185 | } | 185 | } |
186 | .intern(db); | 186 | .intern(db); |
@@ -188,7 +188,7 @@ impl ImplData { | |||
188 | } | 188 | } |
189 | ast::ImplItem::ConstDef(it) => { | 189 | ast::ImplItem::ConstDef(it) => { |
190 | let def = ConstLoc { | 190 | let def = ConstLoc { |
191 | container: ContainerId::ImplId(id), | 191 | container: AssocContainerId::ImplId(id), |
192 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 192 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
193 | } | 193 | } |
194 | .intern(db); | 194 | .intern(db); |
@@ -196,7 +196,7 @@ impl ImplData { | |||
196 | } | 196 | } |
197 | ast::ImplItem::TypeAliasDef(it) => { | 197 | ast::ImplItem::TypeAliasDef(it) => { |
198 | let def = TypeAliasLoc { | 198 | let def = TypeAliasLoc { |
199 | container: ContainerId::ImplId(id), | 199 | container: AssocContainerId::ImplId(id), |
200 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 200 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
201 | } | 201 | } |
202 | .intern(db); | 202 | .intern(db); |
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 4fc3127c4..3d42762ae 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -71,7 +71,7 @@ impl_intern_key!(FunctionId); | |||
71 | 71 | ||
72 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 72 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
73 | pub struct FunctionLoc { | 73 | pub struct FunctionLoc { |
74 | pub container: ContainerId, | 74 | pub container: AssocContainerId, |
75 | pub ast_id: AstId<ast::FnDef>, | 75 | pub ast_id: AstId<ast::FnDef>, |
76 | } | 76 | } |
77 | 77 | ||
@@ -187,7 +187,7 @@ pub struct ConstId(salsa::InternId); | |||
187 | impl_intern_key!(ConstId); | 187 | impl_intern_key!(ConstId); |
188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
189 | pub struct ConstLoc { | 189 | pub struct ConstLoc { |
190 | pub container: ContainerId, | 190 | pub container: AssocContainerId, |
191 | pub ast_id: AstId<ast::ConstDef>, | 191 | pub ast_id: AstId<ast::ConstDef>, |
192 | } | 192 | } |
193 | 193 | ||
@@ -259,7 +259,7 @@ impl_intern_key!(TypeAliasId); | |||
259 | 259 | ||
260 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 260 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
261 | pub struct TypeAliasLoc { | 261 | pub struct TypeAliasLoc { |
262 | pub container: ContainerId, | 262 | pub container: AssocContainerId, |
263 | pub ast_id: AstId<ast::TypeAliasDef>, | 263 | pub ast_id: AstId<ast::TypeAliasDef>, |
264 | } | 264 | } |
265 | 265 | ||
@@ -331,7 +331,7 @@ pub struct LocalTypeParamId(RawId); | |||
331 | impl_arena_id!(LocalTypeParamId); | 331 | impl_arena_id!(LocalTypeParamId); |
332 | 332 | ||
333 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 333 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
334 | pub enum ContainerId { | 334 | pub enum AssocContainerId { |
335 | ModuleId(ModuleId), | 335 | ModuleId(ModuleId), |
336 | ImplId(ImplId), | 336 | ImplId(ImplId), |
337 | TraitId(TraitId), | 337 | TraitId(TraitId), |
@@ -479,13 +479,13 @@ pub trait HasModule { | |||
479 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId; | 479 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId; |
480 | } | 480 | } |
481 | 481 | ||
482 | impl HasModule for ContainerId { | 482 | impl HasModule for AssocContainerId { |
483 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId { | 483 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId { |
484 | match *self { | 484 | match *self { |
485 | ContainerId::ModuleId(it) => it, | 485 | AssocContainerId::ModuleId(it) => it, |
486 | ContainerId::ImplId(it) => it.lookup(db).container, | 486 | AssocContainerId::ImplId(it) => it.lookup(db).container, |
487 | ContainerId::TraitId(it) => it.lookup(db).container, | 487 | AssocContainerId::TraitId(it) => it.lookup(db).container, |
488 | ContainerId::DefWithBodyId(it) => it.module(db), | 488 | AssocContainerId::DefWithBodyId(it) => it.module(db), |
489 | } | 489 | } |
490 | } | 490 | } |
491 | } | 491 | } |
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 8bbf7ffa2..848959f7c 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -24,7 +24,7 @@ use crate::{ | |||
24 | }, | 24 | }, |
25 | path::{ModPath, PathKind}, | 25 | path::{ModPath, PathKind}, |
26 | per_ns::PerNs, | 26 | per_ns::PerNs, |
27 | AdtId, AstId, ConstLoc, ContainerId, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, | 27 | AdtId, AssocContainerId, AstId, ConstLoc, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, |
28 | LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, | 28 | LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, |
29 | TypeAliasLoc, UnionLoc, | 29 | TypeAliasLoc, UnionLoc, |
30 | }; | 30 | }; |
@@ -763,7 +763,7 @@ where | |||
763 | let def: PerNs = match def.kind { | 763 | let def: PerNs = match def.kind { |
764 | raw::DefKind::Function(ast_id) => { | 764 | raw::DefKind::Function(ast_id) => { |
765 | let def = FunctionLoc { | 765 | let def = FunctionLoc { |
766 | container: ContainerId::ModuleId(module), | 766 | container: AssocContainerId::ModuleId(module), |
767 | ast_id: AstId::new(self.file_id, ast_id), | 767 | ast_id: AstId::new(self.file_id, ast_id), |
768 | } | 768 | } |
769 | .intern(self.def_collector.db); | 769 | .intern(self.def_collector.db); |
@@ -787,7 +787,7 @@ where | |||
787 | } | 787 | } |
788 | raw::DefKind::Const(ast_id) => { | 788 | raw::DefKind::Const(ast_id) => { |
789 | let def = ConstLoc { | 789 | let def = ConstLoc { |
790 | container: ContainerId::ModuleId(module), | 790 | container: AssocContainerId::ModuleId(module), |
791 | ast_id: AstId::new(self.file_id, ast_id), | 791 | ast_id: AstId::new(self.file_id, ast_id), |
792 | } | 792 | } |
793 | .intern(self.def_collector.db); | 793 | .intern(self.def_collector.db); |
@@ -808,7 +808,7 @@ where | |||
808 | } | 808 | } |
809 | raw::DefKind::TypeAlias(ast_id) => { | 809 | raw::DefKind::TypeAlias(ast_id) => { |
810 | let def = TypeAliasLoc { | 810 | let def = TypeAliasLoc { |
811 | container: ContainerId::ModuleId(module), | 811 | container: AssocContainerId::ModuleId(module), |
812 | ast_id: AstId::new(self.file_id, ast_id), | 812 | ast_id: AstId::new(self.file_id, ast_id), |
813 | } | 813 | } |
814 | .intern(self.def_collector.db); | 814 | .intern(self.def_collector.db); |
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs index 250329271..d79c9813b 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/ra_hir_def/src/resolver.rs | |||
@@ -17,9 +17,9 @@ use crate::{ | |||
17 | nameres::{BuiltinShadowMode, CrateDefMap}, | 17 | nameres::{BuiltinShadowMode, CrateDefMap}, |
18 | path::{ModPath, PathKind}, | 18 | path::{ModPath, PathKind}, |
19 | per_ns::PerNs, | 19 | per_ns::PerNs, |
20 | AdtId, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, GenericDefId, | 20 | AdtId, AssocContainerId, ConstId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, |
21 | HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, StructId, TraitId, | 21 | GenericDefId, HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, |
22 | TypeAliasId, TypeParamId, VariantId, | 22 | StructId, TraitId, TypeAliasId, TypeParamId, VariantId, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | #[derive(Debug, Clone, Default)] | 25 | #[derive(Debug, Clone, Default)] |
@@ -580,13 +580,13 @@ impl HasResolver for DefWithBodyId { | |||
580 | } | 580 | } |
581 | } | 581 | } |
582 | 582 | ||
583 | impl HasResolver for ContainerId { | 583 | impl HasResolver for AssocContainerId { |
584 | fn resolver(self, db: &impl DefDatabase) -> Resolver { | 584 | fn resolver(self, db: &impl DefDatabase) -> Resolver { |
585 | match self { | 585 | match self { |
586 | ContainerId::TraitId(it) => it.resolver(db), | 586 | AssocContainerId::TraitId(it) => it.resolver(db), |
587 | ContainerId::ImplId(it) => it.resolver(db), | 587 | AssocContainerId::ImplId(it) => it.resolver(db), |
588 | ContainerId::ModuleId(it) => it.resolver(db), | 588 | AssocContainerId::ModuleId(it) => it.resolver(db), |
589 | ContainerId::DefWithBodyId(it) => it.resolver(db), | 589 | AssocContainerId::DefWithBodyId(it) => it.resolver(db), |
590 | } | 590 | } |
591 | } | 591 | } |
592 | } | 592 | } |