@@ -27,11 +27,10 @@ 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 , 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 ,
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 ,
35
34
} ;
36
35
37
36
#[ derive( Debug , Clone ) ]
@@ -1228,7 +1227,11 @@ impl HasResolver for TypeOwnerId {
1228
1227
TypeOwnerId :: TypeAliasId ( it) => it. resolver ( db) ,
1229
1228
TypeOwnerId :: ImplId ( it) => it. resolver ( db) ,
1230
1229
TypeOwnerId :: EnumVariantId ( it) => it. resolver ( db) ,
1231
- TypeOwnerId :: FieldId ( 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
+ } ,
1232
1235
}
1233
1236
}
1234
1237
}
@@ -1241,7 +1244,11 @@ impl HasResolver for DefWithBodyId {
1241
1244
DefWithBodyId :: StaticId ( s) => s. resolver ( db) ,
1242
1245
DefWithBodyId :: VariantId ( v) => v. resolver ( db) ,
1243
1246
DefWithBodyId :: InTypeConstId ( c) => c. lookup ( db) . owner . resolver ( db) ,
1244
- DefWithBodyId :: FieldId ( f) => f. 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
+ } ,
1245
1252
}
1246
1253
}
1247
1254
}
@@ -1288,12 +1295,6 @@ impl HasResolver for VariantId {
1288
1295
}
1289
1296
}
1290
1297
1291
- impl HasResolver for FieldId {
1292
- fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1293
- self . parent . resolver ( db)
1294
- }
1295
- }
1296
-
1297
1298
impl HasResolver for MacroId {
1298
1299
fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1299
1300
match self {
0 commit comments