@@ -1115,10 +1115,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11151115 }
11161116
11171117 fn get_fn_has_self_parameter ( self , id : DefIndex ) -> bool {
1118- match self . kind ( id) {
1119- EntryKind :: AssocFn { has_self } => has_self,
1120- _ => false ,
1121- }
1118+ self . root . tables . fn_has_self_parameter . get ( self , id) . is_some ( )
11221119 }
11231120
11241121 fn get_associated_item_def_ids (
@@ -1138,12 +1135,13 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11381135 fn get_associated_item ( self , id : DefIndex ) -> ty:: AssocItem {
11391136 let name = self . item_name ( id) ;
11401137
1141- let ( kind, has_self ) = match self . kind ( id) {
1142- EntryKind :: AssocConst => ( ty:: AssocKind :: Const , false ) ,
1143- EntryKind :: AssocFn { has_self } => ( ty:: AssocKind :: Fn , has_self ) ,
1144- EntryKind :: AssocType => ( ty:: AssocKind :: Type , false ) ,
1138+ let kind = match self . kind ( id) {
1139+ EntryKind :: AssocConst => ty:: AssocKind :: Const ,
1140+ EntryKind :: AssocFn => ty:: AssocKind :: Fn ,
1141+ EntryKind :: AssocType => ty:: AssocKind :: Type ,
11451142 _ => bug ! ( "cannot get associated-item of `{:?}`" , self . def_key( id) ) ,
11461143 } ;
1144+ let has_self = self . get_fn_has_self_parameter ( id) ;
11471145 let container = self . root . tables . assoc_container . get ( self , id) . unwrap ( ) ;
11481146
11491147 ty:: AssocItem {
0 commit comments