@@ -25,7 +25,7 @@ use std::collections::HashSet;
25
25
use syntax:: abi;
26
26
use syntax:: ast;
27
27
use syntax:: ast_map;
28
- use syntax:: ast_util:: { is_local, PostExpansionMethod } ;
28
+ use syntax:: ast_util:: is_local;
29
29
use syntax:: attr;
30
30
use syntax:: visit:: Visitor ;
31
31
use syntax:: visit;
@@ -53,11 +53,11 @@ fn item_might_be_inlined(item: &ast::Item) -> bool {
53
53
}
54
54
}
55
55
56
- fn method_might_be_inlined ( tcx : & ty:: ctxt , method : & ast:: Method ,
56
+ fn method_might_be_inlined ( tcx : & ty:: ctxt , sig : & ast:: MethodSig ,
57
57
impl_item : & ast:: ImplItem ,
58
58
impl_src : ast:: DefId ) -> bool {
59
59
if attr:: requests_inline ( & impl_item. attrs ) ||
60
- generics_require_inlining ( & method . pe_sig ( ) . generics ) {
60
+ generics_require_inlining ( & sig . generics ) {
61
61
return true
62
62
}
63
63
if is_local ( impl_src) {
@@ -183,15 +183,14 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
183
183
}
184
184
Some ( ast_map:: NodeTraitItem ( trait_method) ) => {
185
185
match trait_method. node {
186
- ast:: RequiredMethod ( _) => false ,
187
- ast:: ProvidedMethod ( _) => true ,
186
+ ast:: MethodTraitItem ( _, ref body) => body. is_some ( ) ,
188
187
ast:: TypeTraitItem ( ..) => false ,
189
188
}
190
189
}
191
190
Some ( ast_map:: NodeImplItem ( impl_item) ) => {
192
191
match impl_item. node {
193
- ast:: MethodImplItem ( ref method ) => {
194
- if generics_require_inlining ( & method . pe_sig ( ) . generics ) ||
192
+ ast:: MethodImplItem ( ref sig , _ ) => {
193
+ if generics_require_inlining ( & sig . generics ) ||
195
194
attr:: requests_inline ( & impl_item. attrs ) {
196
195
true
197
196
} else {
@@ -214,6 +213,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
214
213
}
215
214
}
216
215
ast:: TypeImplItem ( _) => false ,
216
+ ast:: MacImplItem ( _) => self . tcx . sess . bug ( "unexpanded macro" )
217
217
}
218
218
}
219
219
Some ( _) => false ,
@@ -303,24 +303,25 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
303
303
}
304
304
ast_map:: NodeTraitItem ( trait_method) => {
305
305
match trait_method. node {
306
- ast:: RequiredMethod ( .. ) => {
306
+ ast:: MethodTraitItem ( _ , None ) => {
307
307
// Keep going, nothing to get exported
308
308
}
309
- ast:: ProvidedMethod ( ref method ) => {
310
- visit:: walk_block ( self , & * method . pe_body ( ) ) ;
309
+ ast:: MethodTraitItem ( _ , Some ( ref body ) ) => {
310
+ visit:: walk_block ( self , body ) ;
311
311
}
312
312
ast:: TypeTraitItem ( ..) => { }
313
313
}
314
314
}
315
315
ast_map:: NodeImplItem ( impl_item) => {
316
316
match impl_item. node {
317
- ast:: MethodImplItem ( ref method ) => {
317
+ ast:: MethodImplItem ( ref sig , ref body ) => {
318
318
let did = self . tcx . map . get_parent_did ( search_item) ;
319
- if method_might_be_inlined ( self . tcx , method , impl_item, did) {
320
- visit:: walk_block ( self , method . pe_body ( ) )
319
+ if method_might_be_inlined ( self . tcx , sig , impl_item, did) {
320
+ visit:: walk_block ( self , body )
321
321
}
322
322
}
323
323
ast:: TypeImplItem ( _) => { }
324
+ ast:: MacImplItem ( _) => self . tcx . sess . bug ( "unexpanded macro" )
324
325
}
325
326
}
326
327
// Nothing to recurse on for these
0 commit comments