@@ -25,7 +25,7 @@ use std::collections::HashSet;
2525use syntax:: abi;
2626use syntax:: ast;
2727use syntax:: ast_map;
28- use syntax:: ast_util:: { is_local, PostExpansionMethod } ;
28+ use syntax:: ast_util:: is_local;
2929use syntax:: attr;
3030use syntax:: visit:: Visitor ;
3131use syntax:: visit;
@@ -53,11 +53,11 @@ fn item_might_be_inlined(item: &ast::Item) -> bool {
5353 }
5454}
5555
56- fn method_might_be_inlined ( tcx : & ty:: ctxt , method : & ast:: Method ,
56+ fn method_might_be_inlined ( tcx : & ty:: ctxt , sig : & ast:: MethodSig ,
5757 impl_item : & ast:: ImplItem ,
5858 impl_src : ast:: DefId ) -> bool {
5959 if attr:: requests_inline ( & impl_item. attrs ) ||
60- generics_require_inlining ( & method . pe_sig ( ) . generics ) {
60+ generics_require_inlining ( & sig . generics ) {
6161 return true
6262 }
6363 if is_local ( impl_src) {
@@ -183,15 +183,14 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
183183 }
184184 Some ( ast_map:: NodeTraitItem ( trait_method) ) => {
185185 match trait_method. node {
186- ast:: RequiredMethod ( _) => false ,
187- ast:: ProvidedMethod ( _) => true ,
186+ ast:: MethodTraitItem ( _, ref body) => body. is_some ( ) ,
188187 ast:: TypeTraitItem ( ..) => false ,
189188 }
190189 }
191190 Some ( ast_map:: NodeImplItem ( impl_item) ) => {
192191 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 ) ||
195194 attr:: requests_inline ( & impl_item. attrs ) {
196195 true
197196 } else {
@@ -214,6 +213,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
214213 }
215214 }
216215 ast:: TypeImplItem ( _) => false ,
216+ ast:: MacImplItem ( _) => self . tcx . sess . bug ( "unexpanded macro" )
217217 }
218218 }
219219 Some ( _) => false ,
@@ -303,24 +303,25 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
303303 }
304304 ast_map:: NodeTraitItem ( trait_method) => {
305305 match trait_method. node {
306- ast:: RequiredMethod ( .. ) => {
306+ ast:: MethodTraitItem ( _ , None ) => {
307307 // Keep going, nothing to get exported
308308 }
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 ) ;
311311 }
312312 ast:: TypeTraitItem ( ..) => { }
313313 }
314314 }
315315 ast_map:: NodeImplItem ( impl_item) => {
316316 match impl_item. node {
317- ast:: MethodImplItem ( ref method ) => {
317+ ast:: MethodImplItem ( ref sig , ref body ) => {
318318 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 )
321321 }
322322 }
323323 ast:: TypeImplItem ( _) => { }
324+ ast:: MacImplItem ( _) => self . tcx . sess . bug ( "unexpanded macro" )
324325 }
325326 }
326327 // Nothing to recurse on for these
0 commit comments