aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres/collector.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-09 12:34:00 +0000
committerAleksey Kladov <[email protected]>2019-11-09 12:34:00 +0000
commit6294fd5ec9c6946bdd91f1274956c573f9f2a136 (patch)
tree312ae071afe742011c1e396d63123729e31f9815 /crates/ra_hir_def/src/nameres/collector.rs
parentdefc7ad772123a449f7cc384dd46d88c3a45fb53 (diff)
Unfork struct and union ids
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-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()),