44
44
45
45
use rustc:: mir:: visit:: Visitor ;
46
46
use rustc:: mir:: * ;
47
- use rustc:: ty:: TyCtxt ;
48
47
49
48
use rustc_data_structures:: indexed_vec:: Idx ;
50
49
use rustc_data_structures:: unify as ut;
@@ -54,8 +53,8 @@ crate struct EscapingLocals {
54
53
}
55
54
56
55
impl 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 ( ) ;
59
58
visitor. visit_mir ( mir) ;
60
59
61
60
EscapingLocals {
@@ -74,10 +73,8 @@ impl EscapingLocals {
74
73
75
74
/// The MIR visitor gathering the union-find of the locals used in
76
75
/// assignments.
77
- struct GatherAssignedLocalsVisitor < ' cx , ' gcx : ' tcx , ' tcx : ' cx > {
76
+ struct GatherAssignedLocalsVisitor {
78
77
unification_table : ut:: UnificationTable < ut:: InPlace < AssignedLocal > > ,
79
- tcx : TyCtxt < ' cx , ' gcx , ' tcx > ,
80
- mir : & ' cx Mir < ' tcx > ,
81
78
}
82
79
83
80
#[ derive( Copy , Clone , Debug , Hash , PartialEq , Eq ) ]
@@ -107,12 +104,10 @@ impl From<Local> for AssignedLocal {
107
104
}
108
105
}
109
106
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 {
112
109
Self {
113
110
unification_table : ut:: UnificationTable :: new ( ) ,
114
- tcx,
115
- mir,
116
111
}
117
112
}
118
113
@@ -154,7 +149,7 @@ fn find_local_in_operand(op: &Operand) -> Option<Local> {
154
149
}
155
150
}
156
151
157
- impl Visitor < ' tcx > for GatherAssignedLocalsVisitor < ' _ , ' _ , ' tcx > {
152
+ impl Visitor < ' tcx > for GatherAssignedLocalsVisitor {
158
153
fn visit_mir ( & mut self , mir : & Mir < ' tcx > ) {
159
154
// We need as many union-find keys as there are locals
160
155
for _ in 0 ..mir. local_decls . len ( ) {
0 commit comments