@@ -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 } ;
@@ -543,24 +543,13 @@ impl<'tcx, F> Visitor<'tcx> for VisitPlacesWith<F>
543
543
where
544
544
F : FnMut ( Place < ' tcx > , PlaceContext ) ,
545
545
{
546
- fn visit_place ( & mut self , place : & Place < ' tcx > , ctxt : PlaceContext , _: Location ) {
546
+ fn visit_local ( & mut self , local : Local , ctxt : PlaceContext , _: Location ) {
547
+ ( self . 0 ) ( local. into ( ) , ctxt) ;
548
+ }
549
+
550
+ fn visit_place ( & mut self , place : & Place < ' tcx > , ctxt : PlaceContext , location : Location ) {
547
551
( self . 0 ) ( * place, ctxt) ;
548
- for proj in place. projection . iter ( ) {
549
- match proj {
550
- ProjectionElem :: Index ( index) => ( self . 0 ) (
551
- index. into ( ) ,
552
- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) ,
553
- ) ,
554
- ProjectionElem :: Deref
555
- | ProjectionElem :: Field ( ..)
556
- | ProjectionElem :: Downcast ( ..)
557
- | ProjectionElem :: ConstantIndex { .. }
558
- | ProjectionElem :: Subslice { .. }
559
- | ProjectionElem :: OpaqueCast ( ..)
560
- | ProjectionElem :: UnwrapUnsafeBinder ( ..)
561
- | ProjectionElem :: Subtype ( ..) => { }
562
- } ;
563
- }
552
+ self . visit_projection ( place. as_ref ( ) , ctxt, location) ;
564
553
}
565
554
}
566
555
0 commit comments