@@ -32,7 +32,7 @@ use rustc_session::cstore::{
3232use rustc_session:: Session ;
3333use rustc_span:: hygiene:: { ExpnIndex , MacroKind } ;
3434use rustc_span:: source_map:: { respan, Spanned } ;
35- use rustc_span:: symbol:: { sym, Ident , Symbol } ;
35+ use rustc_span:: symbol:: { kw , sym, Ident , Symbol } ;
3636use rustc_span:: { self , BytePos , ExpnId , Pos , Span , SyntaxContext , DUMMY_SP } ;
3737
3838use proc_macro:: bridge:: client:: ProcMacro ;
@@ -1087,8 +1087,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10871087 }
10881088 }
10891089
1090- fn get_fn_has_self_parameter ( self , id : DefIndex ) -> bool {
1091- self . root . tables . fn_has_self_parameter . get ( self , id) . is_some ( )
1090+ fn get_fn_has_self_parameter ( self , id : DefIndex , sess : & ' a Session ) -> bool {
1091+ self . root
1092+ . tables
1093+ . fn_arg_names
1094+ . get ( self , id)
1095+ . unwrap_or_else ( LazyArray :: empty)
1096+ . decode ( ( self , sess) )
1097+ . nth ( 0 )
1098+ . map_or ( false , |ident| ident. name == kw:: SelfLower )
10921099 }
10931100
10941101 fn get_associated_item_def_ids (
@@ -1105,7 +1112,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11051112 . map ( move |child_index| self . local_def_id ( child_index) )
11061113 }
11071114
1108- fn get_associated_item ( self , id : DefIndex ) -> ty:: AssocItem {
1115+ fn get_associated_item ( self , id : DefIndex , sess : & ' a Session ) -> ty:: AssocItem {
11091116 let name = self . item_name ( id) ;
11101117
11111118 let kind = match self . def_kind ( id) {
@@ -1114,7 +1121,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11141121 DefKind :: AssocTy => ty:: AssocKind :: Type ,
11151122 _ => bug ! ( "cannot get associated-item of `{:?}`" , self . def_key( id) ) ,
11161123 } ;
1117- let has_self = self . get_fn_has_self_parameter ( id) ;
1124+ let has_self = self . get_fn_has_self_parameter ( id, sess ) ;
11181125 let container = self . root . tables . assoc_container . get ( self , id) . unwrap ( ) ;
11191126
11201127 ty:: AssocItem {
0 commit comments