diff options
author | Seivan Heidari <[email protected]> | 2019-11-09 15:27:40 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-09 15:27:40 +0000 |
commit | 529b227d42951feabf64c8c964b00e726dd92d46 (patch) | |
tree | d54ea1a30905d4fd8798129103bb13921fb55c94 /crates/ra_hir_def/src/nameres | |
parent | 81662d23a64c7eb7ea10cb7bbf316f17d78dc4bc (diff) | |
parent | 9d786ea221b27fbdf7c7f7beea0290db448e0611 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 11 |
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 | ||
25 | pub(super) fn collect_defs(db: &impl DefDatabase2, mut def_map: CrateDefMap) -> CrateDefMap { | 26 | pub(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()), |