@@ -27,11 +27,10 @@ use crate::{
2727 type_ref:: { LifetimeRef , TypesMap } ,
2828 visibility:: { RawVisibility , Visibility } ,
2929 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 ,
3534} ;
3635
3736#[ derive( Debug , Clone ) ]
@@ -1228,7 +1227,11 @@ impl HasResolver for TypeOwnerId {
12281227 TypeOwnerId :: TypeAliasId ( it) => it. resolver ( db) ,
12291228 TypeOwnerId :: ImplId ( it) => it. resolver ( db) ,
12301229 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+ } ,
12321235 }
12331236 }
12341237}
@@ -1241,7 +1244,11 @@ impl HasResolver for DefWithBodyId {
12411244 DefWithBodyId :: StaticId ( s) => s. resolver ( db) ,
12421245 DefWithBodyId :: VariantId ( v) => v. resolver ( db) ,
12431246 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+ } ,
12451252 }
12461253 }
12471254}
@@ -1288,12 +1295,6 @@ impl HasResolver for VariantId {
12881295 }
12891296}
12901297
1291- impl HasResolver for FieldId {
1292- fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
1293- self . parent . resolver ( db)
1294- }
1295- }
1296-
12971298impl HasResolver for MacroId {
12981299 fn resolver ( self , db : & dyn DefDatabase ) -> Resolver {
12991300 match self {
0 commit comments