@@ -164,7 +164,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
164164
165165 fn run_pass ( & self , tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
166166 let def_id = body. source . def_id ( ) ;
167- let mut allocations = Allocations :: default ( ) ;
167+ let mut candidates = FxIndexMap :: default ( ) ;
168+ let mut candidates_reverse = FxIndexMap :: default ( ) ;
168169 let mut write_info = WriteInfo :: default ( ) ;
169170 trace ! ( func = ?tcx. def_path_str( def_id) ) ;
170171
@@ -196,8 +197,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
196197 let mut candidates = find_candidates (
197198 body,
198199 & borrowed,
199- & mut allocations . candidates ,
200- & mut allocations . candidates_reverse ,
200+ & mut candidates,
201+ & mut candidates_reverse,
201202 ) ;
202203 trace ! ( ?candidates) ;
203204 dest_prop_mir_dump ( tcx, body, & points, & live, round_count) ;
@@ -255,17 +256,6 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
255256 }
256257}
257258
258- /// Container for the various allocations that we need.
259- ///
260- /// We store these here and hand out `&mut` access to them, instead of dropping and recreating them
261- /// frequently. Everything with a `&'alloc` lifetime points into here.
262- #[ derive( Default ) ]
263- struct Allocations {
264- candidates : FxIndexMap < Local , Vec < Local > > ,
265- candidates_reverse : FxIndexMap < Local , Vec < Local > > ,
266- // PERF: Do this for `MaybeLiveLocals` allocations too.
267- }
268-
269259#[ derive( Debug ) ]
270260struct Candidates < ' alloc > {
271261 /// The set of candidates we are considering in this optimization.
0 commit comments