@@ -611,38 +611,38 @@ where
611
611
& mut self ,
612
612
mir_place : & mir:: Place < ' tcx >
613
613
) -> EvalResult < ' tcx , PlaceTy < ' tcx , M :: PointerTag > > {
614
- use rustc:: mir:: Place :: * ;
615
614
use rustc:: mir:: PlaceBase ;
616
- let place = match * mir_place {
617
- Base ( PlaceBase :: Local ( mir:: RETURN_PLACE ) ) => match self . frame ( ) . return_place {
618
- Some ( return_place) =>
619
- // We use our layout to verify our assumption; caller will validate
620
- // their layout on return.
621
- PlaceTy {
622
- place : * return_place,
623
- layout : self . layout_of ( self . monomorphize ( self . frame ( ) . mir . return_ty ( ) ) ?) ?,
615
+
616
+ mir_place. iterate ( |place_base, place_projection| {
617
+ let mut place = match place_base {
618
+ PlaceBase :: Local ( mir:: RETURN_PLACE ) => match self . frame ( ) . return_place {
619
+ Some ( return_place) =>
620
+ // We use our layout to verify our assumption; caller will validate
621
+ // their layout on return.
622
+ PlaceTy {
623
+ place : * return_place,
624
+ layout : self . layout_of ( self . monomorphize ( self . frame ( ) . mir . return_ty ( ) ) ?) ?,
625
+ } ,
626
+ None => return err ! ( InvalidNullPointerUsage ) ,
627
+ } ,
628
+ PlaceBase :: Local ( local) => PlaceTy {
629
+ // This works even for dead/uninitialized locals; we check further when writing
630
+ place : Place :: Local {
631
+ frame : self . cur_frame ( ) ,
632
+ local : * local,
624
633
} ,
625
- None => return err ! ( InvalidNullPointerUsage ) ,
626
- } ,
627
- Base ( PlaceBase :: Local ( local) ) => PlaceTy {
628
- // This works even for dead/uninitialized locals; we check further when writing
629
- place : Place :: Local {
630
- frame : self . cur_frame ( ) ,
631
- local,
634
+ layout : self . layout_of_local ( self . frame ( ) , * local, None ) ?,
632
635
} ,
633
- layout : self . layout_of_local ( self . frame ( ) , local , None ) ? ,
634
- } ,
636
+ _ => self . eval_place_to_mplace ( mir_place ) ? . into ( ) ,
637
+ } ;
635
638
636
- Projection ( ref proj) => {
637
- let place = self . eval_place ( & proj. base ) ?;
638
- self . place_projection ( place, & proj. elem ) ?
639
+ for proj in place_projection {
640
+ place = self . place_projection ( place, & proj. elem ) ?
639
641
}
640
642
641
- _ => self . eval_place_to_mplace ( mir_place) ?. into ( ) ,
642
- } ;
643
-
644
- self . dump_place ( place. place ) ;
645
- Ok ( place)
643
+ self . dump_place ( place. place ) ;
644
+ Ok ( place)
645
+ } )
646
646
}
647
647
648
648
/// Write a scalar to a place
0 commit comments