@@ -328,8 +328,12 @@ impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> {
328328 }
329329}
330330
331- impl < ' a , ' tcx , ' v > Visitor < ' v > for MissingStabilityAnnotations < ' a , ' tcx > {
332- fn visit_item ( & mut self , i : & Item ) {
331+ impl < ' a , ' tcx > Visitor < ' tcx > for MissingStabilityAnnotations < ' a , ' tcx > {
332+ fn nested_visit_map ( & mut self ) -> Option < & hir:: map:: Map < ' tcx > > {
333+ Some ( & self . tcx . map )
334+ }
335+
336+ fn visit_item ( & mut self , i : & ' tcx Item ) {
333337 match i. node {
334338 // Inherent impls and foreign modules serve only as containers for other items,
335339 // they don't have their own stability. They still can be annotated as unstable
@@ -343,35 +347,35 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MissingStabilityAnnotations<'a, 'tcx> {
343347 intravisit:: walk_item ( self , i)
344348 }
345349
346- fn visit_trait_item ( & mut self , ti : & hir:: TraitItem ) {
350+ fn visit_trait_item ( & mut self , ti : & ' tcx hir:: TraitItem ) {
347351 self . check_missing_stability ( ti. id , ti. span ) ;
348352 intravisit:: walk_trait_item ( self , ti) ;
349353 }
350354
351- fn visit_impl_item ( & mut self , ii : & hir:: ImplItem ) {
355+ fn visit_impl_item ( & mut self , ii : & ' tcx hir:: ImplItem ) {
352356 let impl_def_id = self . tcx . map . local_def_id ( self . tcx . map . get_parent ( ii. id ) ) ;
353357 if self . tcx . impl_trait_ref ( impl_def_id) . is_none ( ) {
354358 self . check_missing_stability ( ii. id , ii. span ) ;
355359 }
356360 intravisit:: walk_impl_item ( self , ii) ;
357361 }
358362
359- fn visit_variant ( & mut self , var : & Variant , g : & Generics , item_id : NodeId ) {
363+ fn visit_variant ( & mut self , var : & ' tcx Variant , g : & ' tcx Generics , item_id : NodeId ) {
360364 self . check_missing_stability ( var. node . data . id ( ) , var. span ) ;
361365 intravisit:: walk_variant ( self , var, g, item_id) ;
362366 }
363367
364- fn visit_struct_field ( & mut self , s : & StructField ) {
368+ fn visit_struct_field ( & mut self , s : & ' tcx StructField ) {
365369 self . check_missing_stability ( s. id , s. span ) ;
366370 intravisit:: walk_struct_field ( self , s) ;
367371 }
368372
369- fn visit_foreign_item ( & mut self , i : & hir:: ForeignItem ) {
373+ fn visit_foreign_item ( & mut self , i : & ' tcx hir:: ForeignItem ) {
370374 self . check_missing_stability ( i. id , i. span ) ;
371375 intravisit:: walk_foreign_item ( self , i) ;
372376 }
373377
374- fn visit_macro_def ( & mut self , md : & hir:: MacroDef ) {
378+ fn visit_macro_def ( & mut self , md : & ' tcx hir:: MacroDef ) {
375379 if md. imported_from . is_none ( ) {
376380 self . check_missing_stability ( md. id , md. span ) ;
377381 }
0 commit comments