diff options
author | Aleksey Kladov <[email protected]> | 2019-12-20 11:07:23 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-20 11:07:23 +0000 |
commit | 94ad07af4bef6a70602e315bf315c6fce95618dd (patch) | |
tree | 2e3ab7e72f26a2dd1024479d5146fb8f7d2c2c73 /crates/ra_hir_def/src/nameres/collector.rs | |
parent | 8fc20b65035d93bcc1b3a89127916bd165a8d938 (diff) |
Introduce `ContainerId`
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 848959f7c..0f3319f30 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, AssocContainerId, AstId, ConstLoc, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, | 27 | AdtId, AstId, ConstLoc, ContainerId, 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 | }; |
@@ -760,10 +760,11 @@ where | |||
760 | self.collect_derives(attrs, def); | 760 | self.collect_derives(attrs, def); |
761 | 761 | ||
762 | let name = def.name.clone(); | 762 | let name = def.name.clone(); |
763 | let container = ContainerId::ModuleId(module); | ||
763 | let def: PerNs = match def.kind { | 764 | let def: PerNs = match def.kind { |
764 | raw::DefKind::Function(ast_id) => { | 765 | raw::DefKind::Function(ast_id) => { |
765 | let def = FunctionLoc { | 766 | let def = FunctionLoc { |
766 | container: AssocContainerId::ModuleId(module), | 767 | container: container.into(), |
767 | ast_id: AstId::new(self.file_id, ast_id), | 768 | ast_id: AstId::new(self.file_id, ast_id), |
768 | } | 769 | } |
769 | .intern(self.def_collector.db); | 770 | .intern(self.def_collector.db); |
@@ -787,7 +788,7 @@ where | |||
787 | } | 788 | } |
788 | raw::DefKind::Const(ast_id) => { | 789 | raw::DefKind::Const(ast_id) => { |
789 | let def = ConstLoc { | 790 | let def = ConstLoc { |
790 | container: AssocContainerId::ModuleId(module), | 791 | container: container.into(), |
791 | ast_id: AstId::new(self.file_id, ast_id), | 792 | ast_id: AstId::new(self.file_id, ast_id), |
792 | } | 793 | } |
793 | .intern(self.def_collector.db); | 794 | .intern(self.def_collector.db); |
@@ -808,7 +809,7 @@ where | |||
808 | } | 809 | } |
809 | raw::DefKind::TypeAlias(ast_id) => { | 810 | raw::DefKind::TypeAlias(ast_id) => { |
810 | let def = TypeAliasLoc { | 811 | let def = TypeAliasLoc { |
811 | container: AssocContainerId::ModuleId(module), | 812 | container: container.into(), |
812 | ast_id: AstId::new(self.file_id, ast_id), | 813 | ast_id: AstId::new(self.file_id, ast_id), |
813 | } | 814 | } |
814 | .intern(self.def_collector.db); | 815 | .intern(self.def_collector.db); |