From 94ad07af4bef6a70602e315bf315c6fce95618dd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Dec 2019 12:07:23 +0100 Subject: Introduce `ContainerId` --- crates/ra_hir_def/src/nameres/collector.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_def/src/nameres/collector.rs') 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::{ }, path::{ModPath, PathKind}, per_ns::PerNs, - AdtId, AssocContainerId, AstId, ConstLoc, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, + AdtId, AstId, ConstLoc, ContainerId, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, TypeAliasLoc, UnionLoc, }; @@ -760,10 +760,11 @@ where self.collect_derives(attrs, def); let name = def.name.clone(); + let container = ContainerId::ModuleId(module); let def: PerNs = match def.kind { raw::DefKind::Function(ast_id) => { let def = FunctionLoc { - container: AssocContainerId::ModuleId(module), + container: container.into(), ast_id: AstId::new(self.file_id, ast_id), } .intern(self.def_collector.db); @@ -787,7 +788,7 @@ where } raw::DefKind::Const(ast_id) => { let def = ConstLoc { - container: AssocContainerId::ModuleId(module), + container: container.into(), ast_id: AstId::new(self.file_id, ast_id), } .intern(self.def_collector.db); @@ -808,7 +809,7 @@ where } raw::DefKind::TypeAlias(ast_id) => { let def = TypeAliasLoc { - container: AssocContainerId::ModuleId(module), + container: container.into(), ast_id: AstId::new(self.file_id, ast_id), } .intern(self.def_collector.db); -- cgit v1.2.3