aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-20 10:59:50 +0000
committerAleksey Kladov <[email protected]>2019-12-20 11:00:05 +0000
commit8fc20b65035d93bcc1b3a89127916bd165a8d938 (patch)
tree7e95963bb359eb6eeda8f6aba564fd3eaf7030d2 /crates/ra_hir_def/src/lib.rs
parent67c2aea182c375108ebb8b923f5679e4f7fef1df (diff)
Rename ContainerId -> AssocContainerId
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r--crates/ra_hir_def/src/lib.rs18
1 files changed, 9 insertions, 9 deletions
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)]
73pub struct FunctionLoc { 73pub 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);
187impl_intern_key!(ConstId); 187impl_intern_key!(ConstId);
188#[derive(Debug, Clone, PartialEq, Eq, Hash)] 188#[derive(Debug, Clone, PartialEq, Eq, Hash)]
189pub struct ConstLoc { 189pub 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)]
261pub struct TypeAliasLoc { 261pub 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);
331impl_arena_id!(LocalTypeParamId); 331impl_arena_id!(LocalTypeParamId);
332 332
333#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 333#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
334pub enum ContainerId { 334pub 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
482impl HasModule for ContainerId { 482impl 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}