11use crate :: un_derefer:: UnDerefer ;
2+ use rustc_data_structures:: stable_map:: FxHashMap ;
23use rustc_index:: vec:: IndexVec ;
34use rustc_middle:: mir:: tcx:: RvalueInitializationState ;
45use rustc_middle:: mir:: * ;
@@ -209,7 +210,10 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
209210impl < ' a , ' tcx > MoveDataBuilder < ' a , ' tcx > {
210211 fn finalize (
211212 self ,
212- ) -> Result < MoveData < ' tcx > , ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) > {
213+ ) -> Result <
214+ ( FxHashMap < rustc_middle:: mir:: Local , rustc_middle:: mir:: Place < ' tcx > > , MoveData < ' tcx > ) ,
215+ ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) ,
216+ > {
213217 debug ! ( "{}" , {
214218 debug!( "moves for {:?}:" , self . body. span) ;
215219 for ( j, mo) in self . data. moves. iter_enumerated( ) {
@@ -222,15 +226,22 @@ 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+ Err ( ( self . data , self . errors ) )
231+ } else {
232+ Ok ( ( self . un_derefer . derefer_sidetable . clone ( ) , self . data ) )
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+ ) -> Result <
242+ ( FxHashMap < rustc_middle:: mir:: Local , rustc_middle:: mir:: Place < ' tcx > > , MoveData < ' tcx > ) ,
243+ ( MoveData < ' tcx > , Vec < ( Place < ' tcx > , MoveError < ' tcx > ) > ) ,
244+ > {
234245 let mut builder = MoveDataBuilder :: new ( body, tcx, param_env) ;
235246
236247 builder. gather_args ( ) ;
0 commit comments