@@ -44,8 +44,8 @@ struct VariableLengths {
44
44
}
45
45
46
46
impl < ' a , ' tcx > InferCtxt < ' a , ' tcx > {
47
- fn variable_lengths ( & self ) -> VariableLengths {
48
- let mut inner = self . inner ;
47
+ fn variable_lengths ( & mut self ) -> VariableLengths {
48
+ let inner = & mut self . inner ;
49
49
VariableLengths {
50
50
type_var_len : inner. type_variables ( ) . num_vars ( ) ,
51
51
const_var_len : inner. const_unification_table ( ) . len ( ) ,
@@ -94,7 +94,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
94
94
/// the actual types (`?T`, `Option<?T>`) -- and remember that
95
95
/// after the snapshot is popped, the variable `?T` is no longer
96
96
/// unified.
97
- pub fn fudge_inference_if_ok < T , E , F > ( & self , f : F ) -> Result < T , E >
97
+ pub fn fudge_inference_if_ok < T , E , F > ( & mut self , f : F ) -> Result < T , E >
98
98
where
99
99
F : FnOnce ( ) -> Result < T , E > ,
100
100
T : TypeFoldable < ' tcx > ,
@@ -113,27 +113,26 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
113
113
// going to be popped, so we will have to
114
114
// eliminate any references to them.
115
115
116
- let mut inner = this. inner ;
117
- let type_vars =
116
+ let type_vars = this.
118
117
inner . type_variables ( ) . vars_since_snapshot ( variable_lengths. type_var_len ) ;
119
118
let int_vars = vars_since_snapshot (
120
- & mut inner. int_unification_table ( ) ,
119
+ & mut this . inner . int_unification_table ( ) ,
121
120
variable_lengths. int_var_len ,
122
121
) ;
123
122
let float_vars = vars_since_snapshot (
124
- & mut inner. float_unification_table ( ) ,
123
+ & mut this . inner . float_unification_table ( ) ,
125
124
variable_lengths. float_var_len ,
126
125
) ;
127
- let region_vars = inner
126
+ let region_vars = this . inner
128
127
. unwrap_region_constraints ( )
129
128
. vars_since_snapshot ( variable_lengths. region_constraints_len ) ;
130
129
let const_vars = const_vars_since_snapshot (
131
- & mut inner. const_unification_table ( ) ,
130
+ & mut this . inner . const_unification_table ( ) ,
132
131
variable_lengths. const_var_len ,
133
132
) ;
134
133
135
134
let fudger = InferenceFudger {
136
- infcx : self ,
135
+ infcx : this ,
137
136
type_vars,
138
137
int_vars,
139
138
float_vars,
0 commit comments