From 7b0644d81e52d00a7a6795b187f356213ff68225 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 12 Dec 2019 14:09:13 +0100 Subject: Switch to the new location for impls --- crates/ra_hir_def/src/nameres/collector.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_def/src/nameres') diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index a80067979..b33507a9a 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::{Path, PathKind}, per_ns::PerNs, - AdtId, AstId, AstItemDef, ConstLoc, ContainerId, EnumId, EnumVariantId, FunctionLoc, ImplId, + AdtId, AstId, AstItemDef, ConstLoc, ContainerId, EnumId, EnumVariantId, FunctionLoc, ImplLoc, Intern, LocalImportId, LocalModuleId, LocationCtx, ModuleDefId, ModuleId, StaticLoc, StructId, TraitId, TypeAliasLoc, UnionId, }; @@ -661,9 +661,11 @@ where krate: self.def_collector.def_map.krate, local_id: self.module_id, }; - let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); - let imp_id = ImplId::from_ast_id(ctx, self.raw_items[imp].ast_id); - self.def_collector.def_map.modules[self.module_id].impls.push(imp_id) + let ast_id = self.raw_items[imp].ast_id; + let impl_id = + ImplLoc { container: module, ast_id: AstId::new(self.file_id, ast_id) } + .intern(self.def_collector.db); + self.def_collector.def_map.modules[self.module_id].impls.push(impl_id) } } } -- cgit v1.2.3