1
1
use crate :: un_derefer:: UnDerefer ;
2
+ use rustc_data_structures:: stable_map:: FxHashMap ;
2
3
use rustc_index:: vec:: IndexVec ;
3
4
use rustc_middle:: mir:: tcx:: RvalueInitializationState ;
4
5
use rustc_middle:: mir:: * ;
@@ -209,7 +210,10 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
209
210
impl < ' a , ' tcx > MoveDataBuilder < ' a , ' tcx > {
210
211
fn finalize (
211
212
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
+ > {
213
217
debug ! ( "{}" , {
214
218
debug!( "moves for {:?}:" , self . body. span) ;
215
219
for ( j, mo) in self . data. moves. iter_enumerated( ) {
@@ -222,15 +226,22 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
222
226
"done dumping moves"
223
227
} ) ;
224
228
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
+ }
226
234
}
227
235
}
228
236
229
237
pub ( super ) fn gather_moves < ' tcx > (
230
238
body : & Body < ' tcx > ,
231
239
tcx : TyCtxt < ' tcx > ,
232
240
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
+ > {
234
245
let mut builder = MoveDataBuilder :: new ( body, tcx, param_env) ;
235
246
236
247
builder. gather_args ( ) ;
0 commit comments