@@ -27,10 +27,11 @@ use crate::{
2727 type_ref:: { LifetimeRef , TypesMap } ,
2828 visibility:: { RawVisibility , Visibility } ,
2929 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 ,
3435} ;
3536
3637#[ derive( Debug , Clone ) ]
@@ -1227,11 +1228,7 @@ impl HasResolver for TypeOwnerId {
12271228 TypeOwnerId :: TypeAliasId ( it) => it. resolver ( db) ,
12281229 TypeOwnerId :: ImplId ( it) => it. resolver ( db) ,
12291230 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) ,
12351232 }
12361233 }
12371234}
@@ -1244,11 +1241,7 @@ impl HasResolver for DefWithBodyId {
12441241 DefWithBodyId :: StaticId ( s) => s. resolver ( db) ,
12451242 DefWithBodyId :: VariantId ( v) => v. resolver ( db) ,
12461243 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) ,
12521245 }
12531246 }
12541247}
@@ -1295,6 +1288,12 @@ impl HasResolver for VariantId {
12951288 }
12961289}
12971290
1291+ impl HasResolver for FieldId {
1292+ fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1293+ self . parent . resolver ( db)
1294+ }
1295+ }
1296+
12981297impl HasResolver for MacroId {
12991298 fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
13001299 match self {
0 commit comments