@@ -185,7 +185,7 @@ use rustc::ty::{self, TypeFoldable, Ty, TyCtxt, GenericParamDefKind, Instance};
185
185
use rustc:: ty:: print:: obsolete:: DefPathBasedNames ;
186
186
use rustc:: ty:: adjustment:: { CustomCoerceUnsized , PointerCast } ;
187
187
use 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 } ;
189
189
use rustc:: mir:: visit:: Visitor as MirVisitor ;
190
190
use rustc:: mir:: mono:: { MonoItem , InstantiationMode } ;
191
191
use rustc:: mir:: interpret:: { Scalar , GlobalId , GlobalAlloc , ErrorHandled } ;
@@ -655,14 +655,12 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
655
655
self . super_terminator_kind ( kind, location) ;
656
656
}
657
657
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) , .. } ) => {
666
664
debug ! ( "visiting static {:?} @ {:?}" , def_id, location) ;
667
665
668
666
let tcx = self . tcx ;
@@ -671,10 +669,13 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
671
669
self . output . push ( MonoItem :: Static ( * def_id) ) ;
672
670
}
673
671
}
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
+ }
675
678
}
676
-
677
- self . super_place ( place, context, location) ;
678
679
}
679
680
}
680
681
0 commit comments