@@ -207,13 +207,12 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
207
207
}
208
208
}
209
209
210
+ pub type MoveDat < ' tcx > = ( FxHashMap < Local , Place < ' tcx > > , MoveData < ' tcx > ) ;
211
+
210
212
impl < ' a , ' tcx > MoveDataBuilder < ' a , ' tcx > {
211
213
fn finalize (
212
214
self ,
213
- ) -> Result <
214
- ( FxHashMap < rustc_middle:: mir:: Local , rustc_middle:: mir:: Place < ' tcx > > , MoveData < ' tcx > ) ,
215
- ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) ,
216
- > {
215
+ ) -> Result < MoveDat < ' tcx > , ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) > {
217
216
debug ! ( "{}" , {
218
217
debug!( "moves for {:?}:" , self . body. span) ;
219
218
for ( j, mo) in self . data. moves. iter_enumerated( ) {
@@ -226,10 +225,10 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
226
225
"done dumping moves"
227
226
} ) ;
228
227
229
- if !self . errors . is_empty ( ) {
230
- Err ( ( self . data , self . errors ) )
231
- } else {
228
+ if self . errors . is_empty ( ) {
232
229
Ok ( ( self . un_derefer . derefer_sidetable , self . data ) )
230
+ } else {
231
+ Err ( ( self . data , self . errors ) )
233
232
}
234
233
}
235
234
}
@@ -238,10 +237,7 @@ pub(super) fn gather_moves<'tcx>(
238
237
body : & Body < ' tcx > ,
239
238
tcx : TyCtxt < ' tcx > ,
240
239
param_env : ty:: ParamEnv < ' tcx > ,
241
- ) -> Result <
242
- ( FxHashMap < rustc_middle:: mir:: Local , rustc_middle:: mir:: Place < ' tcx > > , MoveData < ' tcx > ) ,
243
- ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) ,
244
- > {
240
+ ) -> Result < MoveDat < ' tcx > , ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) > {
245
241
let mut builder = MoveDataBuilder :: new ( body, tcx, param_env) ;
246
242
247
243
builder. gather_args ( ) ;
0 commit comments