aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r--crates/ra_hir_def/src/lib.rs18
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};
53use ra_arena::{impl_arena_id, RawId}; 53use ra_arena::Idx;
54use ra_db::{impl_intern_key, salsa, CrateId}; 54use ra_db::{impl_intern_key, salsa, CrateId};
55use ra_syntax::{ast, AstNode}; 55use 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)] 67pub type LocalModuleId = Idx<nameres::ModuleData>;
68pub struct LocalModuleId(RawId);
69impl_arena_id!(LocalModuleId);
70 68
71#[derive(Debug, Clone, PartialEq, Eq, Hash)] 69#[derive(Debug, Clone, PartialEq, Eq, Hash)]
72pub struct ItemLoc<N: AstNode> { 70pub 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)] 128pub type LocalEnumVariantId = Idx<adt::EnumVariantData>;
131pub struct LocalEnumVariantId(RawId);
132impl_arena_id!(LocalEnumVariantId);
133 129
134#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 130#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
135pub struct StructFieldId { 131pub 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)] 136pub type LocalStructFieldId = Idx<adt::StructFieldData>;
141pub struct LocalStructFieldId(RawId);
142impl_arena_id!(LocalStructFieldId);
143 137
144#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 138#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
145pub struct ConstId(salsa::InternId); 139pub 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)] 169pub type LocalTypeParamId = Idx<generics::TypeParamData>;
176pub struct LocalTypeParamId(RawId);
177impl_arena_id!(LocalTypeParamId);
178 170
179macro_rules! impl_froms { 171macro_rules! impl_froms {
180 ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { 172 ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => {