9
9
// except according to those terms.
10
10
11
11
12
- use rustc:: middle:: ty;
13
- use rustc:: mir:: repr:: { self , Mir , BasicBlock , Lvalue , Rvalue } ;
14
- use rustc:: mir:: repr:: { StatementKind , TerminatorKind } ;
12
+ use rustc:: middle:: ty:: TyCtxt ;
13
+ use rustc:: mir:: repr:: * ;
15
14
use rustc:: util:: nodemap:: FnvHashMap ;
16
15
17
16
use std:: cell:: { Cell } ;
@@ -361,7 +360,7 @@ impl<'tcx> MovePathLookup<'tcx> {
361
360
}
362
361
363
362
fn lookup_proj ( & mut self ,
364
- proj : & repr :: LvalueProjection < ' tcx > ,
363
+ proj : & LvalueProjection < ' tcx > ,
365
364
base : MovePathIndex ) -> Lookup < MovePathIndex > {
366
365
let MovePathLookup { ref mut projections,
367
366
ref mut next_index, .. } = * self ;
@@ -484,7 +483,7 @@ impl<'a, 'tcx> MovePathDataBuilder<'a, 'tcx> {
484
483
}
485
484
486
485
impl < ' tcx > MoveData < ' tcx > {
487
- pub fn gather_moves ( mir : & Mir < ' tcx > , tcx : & ty :: TyCtxt < ' tcx > ) -> Self {
486
+ pub fn gather_moves ( mir : & Mir < ' tcx > , tcx : & TyCtxt < ' tcx > ) -> Self {
488
487
gather_moves ( mir, tcx)
489
488
}
490
489
}
@@ -495,7 +494,7 @@ enum StmtKind {
495
494
Aggregate , Drop , CallFn , CallArg , Return ,
496
495
}
497
496
498
- fn gather_moves < ' tcx > ( mir : & Mir < ' tcx > , tcx : & ty :: TyCtxt < ' tcx > ) -> MoveData < ' tcx > {
497
+ fn gather_moves < ' tcx > ( mir : & Mir < ' tcx > , tcx : & TyCtxt < ' tcx > ) -> MoveData < ' tcx > {
499
498
use self :: StmtKind as SK ;
500
499
501
500
let bbs = mir. all_basic_blocks ( ) ;
@@ -554,9 +553,9 @@ fn gather_moves<'tcx>(mir: &Mir<'tcx>, tcx: &ty::TyCtxt<'tcx>) -> MoveData<'tcx>
554
553
Rvalue :: Box ( ref _ty) => {
555
554
// this is creating uninitialized
556
555
// memory that needs to be initialized.
557
- let deref_lval = Lvalue :: Projection ( Box :: new ( repr :: Projection {
556
+ let deref_lval = Lvalue :: Projection ( Box :: new ( Projection {
558
557
base : lval. clone ( ) ,
559
- elem : repr :: ProjectionElem :: Deref ,
558
+ elem : ProjectionElem :: Deref ,
560
559
} ) ) ;
561
560
bb_ctxt. on_move_out_lval ( SK :: Box , & deref_lval, source) ;
562
561
}
@@ -668,7 +667,7 @@ fn gather_moves<'tcx>(mir: &Mir<'tcx>, tcx: &ty::TyCtxt<'tcx>) -> MoveData<'tcx>
668
667
}
669
668
670
669
struct BlockContext < ' b , ' a : ' b , ' tcx : ' a > {
671
- tcx : & ' b ty :: TyCtxt < ' tcx > ,
670
+ tcx : & ' b TyCtxt < ' tcx > ,
672
671
moves : & ' b mut Vec < MoveOut > ,
673
672
builder : MovePathDataBuilder < ' a , ' tcx > ,
674
673
path_map : & ' b mut Vec < Vec < MoveOutIndex > > ,
@@ -678,7 +677,7 @@ struct BlockContext<'b, 'a: 'b, 'tcx: 'a> {
678
677
impl < ' b , ' a : ' b , ' tcx : ' a > BlockContext < ' b , ' a , ' tcx > {
679
678
fn on_move_out_lval ( & mut self ,
680
679
stmt_kind : StmtKind ,
681
- lval : & repr :: Lvalue < ' tcx > ,
680
+ lval : & Lvalue < ' tcx > ,
682
681
source : Location ) {
683
682
let tcx = self . tcx ;
684
683
let lval_ty = self . builder . mir . lvalue_ty ( tcx, lval) ;
@@ -724,10 +723,10 @@ impl<'b, 'a: 'b, 'tcx: 'a> BlockContext<'b, 'a, 'tcx> {
724
723
self . loc_map_bb [ i] . push ( index) ;
725
724
}
726
725
727
- fn on_operand ( & mut self , stmt_kind : StmtKind , operand : & repr :: Operand < ' tcx > , source : Location ) {
726
+ fn on_operand ( & mut self , stmt_kind : StmtKind , operand : & Operand < ' tcx > , source : Location ) {
728
727
match * operand {
729
- repr :: Operand :: Constant ( ..) => { } // not-a-move
730
- repr :: Operand :: Consume ( ref lval) => { // a move
728
+ Operand :: Constant ( ..) => { } // not-a-move
729
+ Operand :: Consume ( ref lval) => { // a move
731
730
self . on_move_out_lval ( stmt_kind, lval, source) ;
732
731
}
733
732
}
0 commit comments