aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs11
1 files changed, 7 insertions, 4 deletions
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::{
19 }, 19 },
20 path::{Path, PathKind}, 20 path::{Path, PathKind},
21 AdtId, AstId, AstItemDef, ConstId, CrateModuleId, EnumId, EnumVariantId, FunctionId, 21 AdtId, AstId, AstItemDef, ConstId, CrateModuleId, EnumId, EnumVariantId, FunctionId,
22 LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, TraitId, TypeAliasId, UnionId, 22 LocationCtx, ModuleDefId, ModuleId, StaticId, StructId, StructOrUnionId, TraitId, TypeAliasId,
23 UnionId,
23}; 24};
24 25
25pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { 26pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap {
@@ -664,12 +665,14 @@ where
664 PerNs::values(FunctionId::from_ast_id(ctx, ast_id).into()) 665 PerNs::values(FunctionId::from_ast_id(ctx, ast_id).into())
665 } 666 }
666 raw::DefKind::Struct(ast_id) => { 667 raw::DefKind::Struct(ast_id) => {
667 let s = StructId::from_ast_id(ctx, ast_id).into(); 668 let id = StructOrUnionId::from_ast_id(ctx, ast_id).into();
669 let s = StructId(id).into();
668 PerNs::both(s, s) 670 PerNs::both(s, s)
669 } 671 }
670 raw::DefKind::Union(ast_id) => { 672 raw::DefKind::Union(ast_id) => {
671 let s = UnionId::from_ast_id(ctx, ast_id).into(); 673 let id = StructOrUnionId::from_ast_id(ctx, ast_id).into();
672 PerNs::both(s, s) 674 let u = UnionId(id).into();
675 PerNs::both(u, u)
673 } 676 }
674 raw::DefKind::Enum(ast_id) => PerNs::types(EnumId::from_ast_id(ctx, ast_id).into()), 677 raw::DefKind::Enum(ast_id) => PerNs::types(EnumId::from_ast_id(ctx, ast_id).into()),
675 raw::DefKind::Const(ast_id) => PerNs::values(ConstId::from_ast_id(ctx, ast_id).into()), 678 raw::DefKind::Const(ast_id) => PerNs::values(ConstId::from_ast_id(ctx, ast_id).into()),