diff options
Diffstat (limited to 'crates/hir/src/from_id.rs')
-rw-r--r-- | crates/hir/src/from_id.rs | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/crates/hir/src/from_id.rs b/crates/hir/src/from_id.rs index a53ac1e08..033f53ac2 100644 --- a/crates/hir/src/from_id.rs +++ b/crates/hir/src/from_id.rs | |||
@@ -4,13 +4,13 @@ | |||
4 | //! are splitting the hir. | 4 | //! are splitting the hir. |
5 | 5 | ||
6 | use hir_def::{ | 6 | use hir_def::{ |
7 | expr::PatId, AdtId, AssocItemId, AttrDefId, DefWithBodyId, EnumVariantId, FieldId, | 7 | expr::PatId, AdtId, AssocItemId, DefWithBodyId, EnumVariantId, FieldId, GenericDefId, |
8 | GenericDefId, ModuleDefId, VariantId, | 8 | ModuleDefId, VariantId, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | code_model::ItemInNs, Adt, AssocItem, AttrDef, DefWithBody, EnumVariant, Field, GenericDef, | 12 | code_model::ItemInNs, Adt, AssocItem, DefWithBody, EnumVariant, Field, GenericDef, Local, |
13 | Local, MacroDef, ModuleDef, VariantDef, | 13 | MacroDef, ModuleDef, VariantDef, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | macro_rules! from_id { | 16 | macro_rules! from_id { |
@@ -196,23 +196,6 @@ impl From<FieldId> for Field { | |||
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | impl From<AttrDef> for AttrDefId { | ||
200 | fn from(def: AttrDef) -> Self { | ||
201 | match def { | ||
202 | AttrDef::Module(it) => AttrDefId::ModuleId(it.id), | ||
203 | AttrDef::Field(it) => AttrDefId::FieldId(it.into()), | ||
204 | AttrDef::Adt(it) => AttrDefId::AdtId(it.into()), | ||
205 | AttrDef::Function(it) => AttrDefId::FunctionId(it.id), | ||
206 | AttrDef::EnumVariant(it) => AttrDefId::EnumVariantId(it.into()), | ||
207 | AttrDef::Static(it) => AttrDefId::StaticId(it.id), | ||
208 | AttrDef::Const(it) => AttrDefId::ConstId(it.id), | ||
209 | AttrDef::Trait(it) => AttrDefId::TraitId(it.id), | ||
210 | AttrDef::TypeAlias(it) => AttrDefId::TypeAliasId(it.id), | ||
211 | AttrDef::MacroDef(it) => AttrDefId::MacroDefId(it.id), | ||
212 | } | ||
213 | } | ||
214 | } | ||
215 | |||
216 | impl From<AssocItem> for GenericDefId { | 199 | impl From<AssocItem> for GenericDefId { |
217 | fn from(item: AssocItem) -> Self { | 200 | fn from(item: AssocItem) -> Self { |
218 | match item { | 201 | match item { |