From 6294fd5ec9c6946bdd91f1274956c573f9f2a136 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 9 Nov 2019 15:34:00 +0300 Subject: Unfork struct and union ids --- crates/ra_hir_def/src/nameres/collector.rs | 11 +++++++---- 1 file changed, 7 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 aacd50df8..7e6083961 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -19,7 +19,8 @@ use crate::{ }, path::{Path, PathKind}, AdtId, AstId, AstItemDef, ConstId, CrateModuleId, EnumId, EnumVariantId, FunctionId, - LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, TraitId, TypeAliasId, UnionId, + LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, StructOrUnionId, TraitId, TypeAliasId, + UnionId, }; pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { @@ -664,12 +665,14 @@ where PerNs::values(FunctionId::from_ast_id(ctx, ast_id).into()) } raw::DefKind::Struct(ast_id) => { - let s = StructId::from_ast_id(ctx, ast_id).into(); + let id = StructOrUnionId::from_ast_id(ctx, ast_id).into(); + let s = StructId(id).into(); PerNs::both(s, s) } raw::DefKind::Union(ast_id) => { - let s = UnionId::from_ast_id(ctx, ast_id).into(); - PerNs::both(s, s) + let id = StructOrUnionId::from_ast_id(ctx, ast_id).into(); + let u = UnionId(id).into(); + PerNs::both(u, u) } raw::DefKind::Enum(ast_id) => PerNs::types(EnumId::from_ast_id(ctx, ast_id).into()), raw::DefKind::Const(ast_id) => PerNs::values(ConstId::from_ast_id(ctx, ast_id).into()), -- cgit v1.2.3