diff options
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index d0f043ed0..516dd773e 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -50,7 +50,7 @@ use hir_expand::{ | |||
50 | ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, | 50 | ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile, |
51 | MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, | 51 | MacroCallId, MacroCallKind, MacroDefId, MacroDefKind, |
52 | }; | 52 | }; |
53 | use ra_arena::{impl_arena_id, RawId}; | 53 | use ra_arena::Idx; |
54 | use ra_db::{impl_intern_key, salsa, CrateId}; | 54 | use ra_db::{impl_intern_key, salsa, CrateId}; |
55 | use ra_syntax::{ast, AstNode}; | 55 | use ra_syntax::{ast, AstNode}; |
56 | 56 | ||
@@ -64,9 +64,7 @@ pub struct ModuleId { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | /// An ID of a module, **local** to a specific crate | 66 | /// An ID of a module, **local** to a specific crate |
67 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 67 | pub type LocalModuleId = Idx<nameres::ModuleData>; |
68 | pub struct LocalModuleId(RawId); | ||
69 | impl_arena_id!(LocalModuleId); | ||
70 | 68 | ||
71 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 69 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
72 | pub struct ItemLoc<N: AstNode> { | 70 | pub struct ItemLoc<N: AstNode> { |
@@ -127,9 +125,7 @@ pub struct EnumVariantId { | |||
127 | pub local_id: LocalEnumVariantId, | 125 | pub local_id: LocalEnumVariantId, |
128 | } | 126 | } |
129 | 127 | ||
130 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 128 | pub type LocalEnumVariantId = Idx<adt::EnumVariantData>; |
131 | pub struct LocalEnumVariantId(RawId); | ||
132 | impl_arena_id!(LocalEnumVariantId); | ||
133 | 129 | ||
134 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 130 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
135 | pub struct StructFieldId { | 131 | pub struct StructFieldId { |
@@ -137,9 +133,7 @@ pub struct StructFieldId { | |||
137 | pub local_id: LocalStructFieldId, | 133 | pub local_id: LocalStructFieldId, |
138 | } | 134 | } |
139 | 135 | ||
140 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 136 | pub type LocalStructFieldId = Idx<adt::StructFieldData>; |
141 | pub struct LocalStructFieldId(RawId); | ||
142 | impl_arena_id!(LocalStructFieldId); | ||
143 | 137 | ||
144 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 138 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
145 | pub struct ConstId(salsa::InternId); | 139 | pub struct ConstId(salsa::InternId); |
@@ -172,9 +166,7 @@ pub struct TypeParamId { | |||
172 | pub local_id: LocalTypeParamId, | 166 | pub local_id: LocalTypeParamId, |
173 | } | 167 | } |
174 | 168 | ||
175 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 169 | pub type LocalTypeParamId = Idx<generics::TypeParamData>; |
176 | pub struct LocalTypeParamId(RawId); | ||
177 | impl_arena_id!(LocalTypeParamId); | ||
178 | 170 | ||
179 | macro_rules! impl_froms { | 171 | macro_rules! impl_froms { |
180 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { | 172 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { |