@@ -27,10 +27,11 @@ use crate::{
27
27
type_ref:: { LifetimeRef , TypesMap } ,
28
28
visibility:: { RawVisibility , Visibility } ,
29
29
AdtId , ConstId , ConstParamId , CrateRootModuleId , DefWithBodyId , EnumId , EnumVariantId ,
30
- ExternBlockId , ExternCrateId , FunctionId , FxIndexMap , GenericDefId , GenericParamId , HasModule ,
31
- ImplId , ItemContainerId , ItemTreeLoc , LifetimeParamId , LocalModuleId , Lookup , Macro2Id ,
32
- MacroId , MacroRulesId , ModuleDefId , ModuleId , ProcMacroId , StaticId , StructId , TraitAliasId ,
33
- TraitId , TypeAliasId , TypeOrConstParamId , TypeOwnerId , TypeParamId , UseId , VariantId ,
30
+ ExternBlockId , ExternCrateId , FieldId , FunctionId , FxIndexMap , GenericDefId , GenericParamId ,
31
+ HasModule , ImplId , ItemContainerId , ItemTreeLoc , LifetimeParamId , LocalModuleId , Lookup ,
32
+ Macro2Id , MacroId , MacroRulesId , ModuleDefId , ModuleId , ProcMacroId , StaticId , StructId ,
33
+ TraitAliasId , TraitId , TypeAliasId , TypeOrConstParamId , TypeOwnerId , TypeParamId , UseId ,
34
+ VariantId ,
34
35
} ;
35
36
36
37
#[ derive( Debug , Clone ) ]
@@ -1227,11 +1228,7 @@ impl HasResolver for TypeOwnerId {
1227
1228
TypeOwnerId :: TypeAliasId ( it) => it. resolver ( db) ,
1228
1229
TypeOwnerId :: ImplId ( it) => it. resolver ( db) ,
1229
1230
TypeOwnerId :: EnumVariantId ( it) => it. resolver ( db) ,
1230
- TypeOwnerId :: FieldId ( it) => match it. parent {
1231
- VariantId :: EnumVariantId ( it) => it. resolver ( db) ,
1232
- VariantId :: StructId ( it) => it. resolver ( db) ,
1233
- VariantId :: UnionId ( it) => it. resolver ( db) ,
1234
- } ,
1231
+ TypeOwnerId :: FieldId ( it) => it. resolver ( db) ,
1235
1232
}
1236
1233
}
1237
1234
}
@@ -1244,11 +1241,7 @@ impl HasResolver for DefWithBodyId {
1244
1241
DefWithBodyId :: StaticId ( s) => s. resolver ( db) ,
1245
1242
DefWithBodyId :: VariantId ( v) => v. resolver ( db) ,
1246
1243
DefWithBodyId :: InTypeConstId ( c) => c. lookup ( db) . owner . resolver ( db) ,
1247
- DefWithBodyId :: FieldId ( f) => match f. parent {
1248
- VariantId :: EnumVariantId ( it) => it. resolver ( db) ,
1249
- VariantId :: StructId ( it) => it. resolver ( db) ,
1250
- VariantId :: UnionId ( it) => it. resolver ( db) ,
1251
- } ,
1244
+ DefWithBodyId :: FieldId ( f) => f. resolver ( db) ,
1252
1245
}
1253
1246
}
1254
1247
}
@@ -1295,6 +1288,12 @@ impl HasResolver for VariantId {
1295
1288
}
1296
1289
}
1297
1290
1291
+ impl HasResolver for FieldId {
1292
+ fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1293
+ self . parent . resolver ( db)
1294
+ }
1295
+ }
1296
+
1298
1297
impl HasResolver for MacroId {
1299
1298
fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1300
1299
match self {
0 commit comments