4444
4545use rustc:: mir:: visit:: Visitor ;
4646use rustc:: mir:: * ;
47- use rustc:: ty:: TyCtxt ;
4847
4948use rustc_data_structures:: indexed_vec:: Idx ;
5049use rustc_data_structures:: unify as ut;
@@ -54,8 +53,8 @@ crate struct EscapingLocals {
5453}
5554
5655impl EscapingLocals {
57- crate fn compute ( tcx : TyCtxt < ' _ , ' _ , ' tcx > , mir : & Mir < ' tcx > ) -> Self {
58- let mut visitor = GatherAssignedLocalsVisitor :: new ( tcx , mir ) ;
56+ crate fn compute ( mir : & Mir < ' tcx > ) -> Self {
57+ let mut visitor = GatherAssignedLocalsVisitor :: new ( ) ;
5958 visitor. visit_mir ( mir) ;
6059
6160 EscapingLocals {
@@ -74,10 +73,8 @@ impl EscapingLocals {
7473
7574/// The MIR visitor gathering the union-find of the locals used in
7675/// assignments.
77- struct GatherAssignedLocalsVisitor < ' cx , ' gcx : ' tcx , ' tcx : ' cx > {
76+ struct GatherAssignedLocalsVisitor {
7877 unification_table : ut:: UnificationTable < ut:: InPlace < AssignedLocal > > ,
79- tcx : TyCtxt < ' cx , ' gcx , ' tcx > ,
80- mir : & ' cx Mir < ' tcx > ,
8178}
8279
8380#[ derive( Copy , Clone , Debug , Hash , PartialEq , Eq ) ]
@@ -107,12 +104,10 @@ impl From<Local> for AssignedLocal {
107104 }
108105}
109106
110- impl GatherAssignedLocalsVisitor < ' cx , ' gcx , ' tcx > {
111- fn new ( tcx : TyCtxt < ' cx , ' gcx , ' tcx > , mir : & ' cx Mir < ' tcx > ) -> Self {
107+ impl GatherAssignedLocalsVisitor {
108+ fn new ( ) -> Self {
112109 Self {
113110 unification_table : ut:: UnificationTable :: new ( ) ,
114- tcx,
115- mir,
116111 }
117112 }
118113
@@ -154,7 +149,7 @@ fn find_local_in_operand(op: &Operand) -> Option<Local> {
154149 }
155150}
156151
157- impl Visitor < ' tcx > for GatherAssignedLocalsVisitor < ' _ , ' _ , ' tcx > {
152+ impl Visitor < ' tcx > for GatherAssignedLocalsVisitor {
158153 fn visit_mir ( & mut self , mir : & Mir < ' tcx > ) {
159154 // We need as many union-find keys as there are locals
160155 for _ in 0 ..mir. local_decls . len ( ) {
0 commit comments