File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,27 @@ impl<'tcx> MutVisitor<'tcx> for LocalUpdater {
366366 } ) ;
367367 self . super_basic_block_data ( block, data) ;
368368 }
369+
369370 fn visit_local ( & mut self , l : & mut Local , _: PlaceContext , _: Location ) {
370371 * l = self . map [ * l] . unwrap ( ) ;
371372 }
373+
374+ fn visit_place (
375+ & mut self ,
376+ place : & mut Place < ' tcx > ,
377+ context : PlaceContext ,
378+ location : Location ,
379+ ) {
380+ self . visit_place_base ( & mut place. base , context, location) ;
381+
382+ let new_projection: Vec < _ > = place. projection . iter ( ) . map ( |elem|
383+ if let PlaceElem :: Index ( local) = elem {
384+ PlaceElem :: Index ( self . map [ * local] . unwrap ( ) )
385+ } else {
386+ elem. clone ( )
387+ }
388+ ) . collect ( ) ;
389+
390+ place. projection = new_projection. into_boxed_slice ( ) ;
391+ }
372392}
You can’t perform that action at this time.
0 commit comments