@@ -13,9 +13,9 @@ use rustc_middle::{mir, ty};
1313use rustc_target:: abi:: { self , Abi , HasDataLayout , Size } ;
1414
1515use super :: {
16- alloc_range, from_known_layout, mir_assign_valid_types, CtfeProvenance , Frame , InterpCx ,
17- InterpResult , MPlaceTy , Machine , MemPlace , MemPlaceMeta , OffsetMode , PlaceTy , Pointer ,
18- Projectable , Provenance , Scalar ,
16+ alloc_range, from_known_layout, mir_assign_valid_types, CtfeProvenance , InterpCx , InterpResult ,
17+ MPlaceTy , Machine , MemPlace , MemPlaceMeta , OffsetMode , PlaceTy , Pointer , Projectable ,
18+ Provenance , Scalar ,
1919} ;
2020
2121/// An `Immediate` represents a single immediate self-contained Rust value.
@@ -633,17 +633,17 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
633633 }
634634 }
635635
636- /// Read from a local.
636+ /// Read from a local of the current frame .
637637 /// Will not access memory, instead an indirect `Operand` is returned.
638638 ///
639639 /// This is public because it is used by [priroda](https://github.com/oli-obk/priroda) to get an
640640 /// OpTy from a local.
641641 pub fn local_to_op (
642642 & self ,
643- frame : & Frame < ' mir , ' tcx , M :: Provenance , M :: FrameExtra > ,
644643 local : mir:: Local ,
645644 layout : Option < TyAndLayout < ' tcx > > ,
646645 ) -> InterpResult < ' tcx , OpTy < ' tcx , M :: Provenance > > {
646+ let frame = self . frame ( ) ;
647647 let layout = self . layout_of_local ( frame, local, layout) ?;
648648 let op = * frame. locals [ local] . access ( ) ?;
649649 if matches ! ( op, Operand :: Immediate ( _) ) {
@@ -664,7 +664,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
664664 Right ( ( local, offset, locals_addr) ) => {
665665 debug_assert ! ( place. layout. is_sized( ) ) ; // only sized locals can ever be `Place::Local`.
666666 debug_assert_eq ! ( locals_addr, self . frame( ) . locals_addr( ) ) ;
667- let base = self . local_to_op ( & self . frame ( ) , local, None ) ?;
667+ let base = self . local_to_op ( local, None ) ?;
668668 Ok ( match offset {
669669 Some ( offset) => base. offset ( offset, place. layout , self ) ?,
670670 None => {
@@ -688,7 +688,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
688688 // here is not the entire place.
689689 let layout = if mir_place. projection . is_empty ( ) { layout } else { None } ;
690690
691- let mut op = self . local_to_op ( self . frame ( ) , mir_place. local , layout) ?;
691+ let mut op = self . local_to_op ( mir_place. local , layout) ?;
692692 // Using `try_fold` turned out to be bad for performance, hence the loop.
693693 for elem in mir_place. projection . iter ( ) {
694694 op = self . project ( & op, elem) ?
0 commit comments