1+ use crate :: move_paths:: FxHashMap ;
12use crate :: un_derefer:: UnDerefer ;
23use rustc_index:: vec:: IndexVec ;
34use rustc_middle:: mir:: tcx:: RvalueInitializationState ;
@@ -206,10 +207,13 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
206207 }
207208}
208209
210+ pub type MoveDat < ' tcx > = Result <
211+ ( FxHashMap < Local , Place < ' tcx > > , MoveData < ' tcx > ) ,
212+ ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) ,
213+ > ;
214+
209215impl < ' a , ' tcx > MoveDataBuilder < ' a , ' tcx > {
210- fn finalize (
211- self ,
212- ) -> Result < MoveData < ' tcx > , ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) > {
216+ fn finalize ( self ) -> MoveDat < ' tcx > {
213217 debug ! ( "{}" , {
214218 debug!( "moves for {:?}:" , self . body. span) ;
215219 for ( j, mo) in self . data. moves. iter_enumerated( ) {
@@ -222,15 +226,19 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
222226 "done dumping moves"
223227 } ) ;
224228
225- if !self . errors . is_empty ( ) { Err ( ( self . data , self . errors ) ) } else { Ok ( self . data ) }
229+ if self . errors . is_empty ( ) {
230+ Ok ( ( self . un_derefer . derefer_sidetable , self . data ) )
231+ } else {
232+ Err ( ( self . data , self . errors ) )
233+ }
226234 }
227235}
228236
229237pub ( super ) fn gather_moves < ' tcx > (
230238 body : & Body < ' tcx > ,
231239 tcx : TyCtxt < ' tcx > ,
232240 param_env : ty:: ParamEnv < ' tcx > ,
233- ) -> Result < MoveData < ' tcx > , ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) > {
241+ ) -> MoveDat < ' tcx > {
234242 let mut builder = MoveDataBuilder :: new ( body, tcx, param_env) ;
235243
236244 builder. gather_args ( ) ;
0 commit comments