@@ -141,7 +141,7 @@ use rustc_data_structures::fx::FxIndexMap;
141
141
use rustc_index:: bit_set:: DenseBitSet ;
142
142
use rustc_index:: interval:: SparseIntervalMatrix ;
143
143
use rustc_index:: { IndexVec , newtype_index} ;
144
- use rustc_middle:: mir:: visit:: { MutVisitor , NonMutatingUseContext , PlaceContext , Visitor } ;
144
+ use rustc_middle:: mir:: visit:: { MutVisitor , PlaceContext , Visitor } ;
145
145
use rustc_middle:: mir:: * ;
146
146
use rustc_middle:: ty:: TyCtxt ;
147
147
use rustc_mir_dataflow:: impls:: { DefUse , MaybeLiveLocals } ;
@@ -555,24 +555,13 @@ impl<'tcx, F> Visitor<'tcx> for VisitPlacesWith<F>
555
555
where
556
556
F : FnMut ( Place < ' tcx > , PlaceContext ) ,
557
557
{
558
- fn visit_place ( & mut self , place : & Place < ' tcx > , ctxt : PlaceContext , _: Location ) {
558
+ fn visit_local ( & mut self , local : Local , ctxt : PlaceContext , _: Location ) {
559
+ ( self . 0 ) ( local. into ( ) , ctxt) ;
560
+ }
561
+
562
+ fn visit_place ( & mut self , place : & Place < ' tcx > , ctxt : PlaceContext , location : Location ) {
559
563
( self . 0 ) ( * place, ctxt) ;
560
- for proj in place. projection . iter ( ) {
561
- match proj {
562
- ProjectionElem :: Index ( index) => ( self . 0 ) (
563
- index. into ( ) ,
564
- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) ,
565
- ) ,
566
- ProjectionElem :: Deref
567
- | ProjectionElem :: Field ( ..)
568
- | ProjectionElem :: Downcast ( ..)
569
- | ProjectionElem :: ConstantIndex { .. }
570
- | ProjectionElem :: Subslice { .. }
571
- | ProjectionElem :: OpaqueCast ( ..)
572
- | ProjectionElem :: UnwrapUnsafeBinder ( ..)
573
- | ProjectionElem :: Subtype ( ..) => { }
574
- } ;
575
- }
564
+ self . visit_projection ( place. as_ref ( ) , ctxt, location) ;
576
565
}
577
566
}
578
567
0 commit comments