@@ -32,7 +32,7 @@ use rustc_session::cstore::{
32
32
use rustc_session:: Session ;
33
33
use rustc_span:: hygiene:: { ExpnIndex , MacroKind } ;
34
34
use rustc_span:: source_map:: { respan, Spanned } ;
35
- use rustc_span:: symbol:: { sym, Ident , Symbol } ;
35
+ use rustc_span:: symbol:: { kw , sym, Ident , Symbol } ;
36
36
use rustc_span:: { self , BytePos , ExpnId , Pos , Span , SyntaxContext , DUMMY_SP } ;
37
37
38
38
use proc_macro:: bridge:: client:: ProcMacro ;
@@ -1087,8 +1087,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1087
1087
}
1088
1088
}
1089
1089
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 )
1092
1099
}
1093
1100
1094
1101
fn get_associated_item_def_ids (
@@ -1105,7 +1112,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1105
1112
. map ( move |child_index| self . local_def_id ( child_index) )
1106
1113
}
1107
1114
1108
- fn get_associated_item ( self , id : DefIndex ) -> ty:: AssocItem {
1115
+ fn get_associated_item ( self , id : DefIndex , sess : & ' a Session ) -> ty:: AssocItem {
1109
1116
let name = self . item_name ( id) ;
1110
1117
1111
1118
let kind = match self . def_kind ( id) {
@@ -1114,7 +1121,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1114
1121
DefKind :: AssocTy => ty:: AssocKind :: Type ,
1115
1122
_ => bug ! ( "cannot get associated-item of `{:?}`" , self . def_key( id) ) ,
1116
1123
} ;
1117
- let has_self = self . get_fn_has_self_parameter ( id) ;
1124
+ let has_self = self . get_fn_has_self_parameter ( id, sess ) ;
1118
1125
let container = self . root . tables . assoc_container . get ( self , id) . unwrap ( ) ;
1119
1126
1120
1127
ty:: AssocItem {
0 commit comments