@@ -185,7 +185,7 @@ use rustc::ty::{self, TypeFoldable, Ty, TyCtxt, GenericParamDefKind, Instance};
185185use rustc:: ty:: print:: obsolete:: DefPathBasedNames ;
186186use rustc:: ty:: adjustment:: { CustomCoerceUnsized , PointerCast } ;
187187use rustc:: session:: config:: EntryFnType ;
188- use rustc:: mir:: { self , Location , Place , PlaceBase , Promoted , Static , StaticKind } ;
188+ use rustc:: mir:: { self , Location , PlaceBase , Promoted , Static , StaticKind } ;
189189use rustc:: mir:: visit:: Visitor as MirVisitor ;
190190use rustc:: mir:: mono:: { MonoItem , InstantiationMode } ;
191191use rustc:: mir:: interpret:: { Scalar , GlobalId , GlobalAlloc , ErrorHandled } ;
@@ -655,14 +655,12 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
655655 self . super_terminator_kind ( kind, location) ;
656656 }
657657
658- fn visit_place ( & mut self ,
659- place : & mir:: Place < ' tcx > ,
660- context : mir:: visit:: PlaceContext ,
661- location : Location ) {
662- match place {
663- Place :: Base (
664- PlaceBase :: Static ( box Static { kind : StaticKind :: Static ( def_id) , .. } )
665- ) => {
658+ fn visit_place_base ( & mut self ,
659+ place_base : & mir:: PlaceBase < ' tcx > ,
660+ _context : mir:: visit:: PlaceContext ,
661+ location : Location ) {
662+ match place_base {
663+ PlaceBase :: Static ( box Static { kind : StaticKind :: Static ( def_id) , .. } ) => {
666664 debug ! ( "visiting static {:?} @ {:?}" , def_id, location) ;
667665
668666 let tcx = self . tcx ;
@@ -671,10 +669,13 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
671669 self . output . push ( MonoItem :: Static ( * def_id) ) ;
672670 }
673671 }
674- _ => { }
672+ PlaceBase :: Static ( box Static { kind : StaticKind :: Promoted ( _) , .. } ) => {
673+ // FIXME: should we handle promoteds here instead of eagerly in collect_neighbours?
674+ }
675+ PlaceBase :: Local ( _) => {
676+ // Locals have no relevance for collector
677+ }
675678 }
676-
677- self . super_place ( place, context, location) ;
678679 }
679680}
680681
0 commit comments