@@ -159,11 +159,11 @@ pub macro run_passes(
159
159
$tcx: ident,
160
160
$mir: ident,
161
161
$def_id: ident,
162
- $suite_index: expr,
163
162
$mir_phase: expr;
164
163
$( $pass: expr, ) *
165
164
) { {
166
- let suite_index: usize = $suite_index;
165
+ let phase_index = $mir_phase. phase_index ( ) ;
166
+
167
167
let run_passes = |mir : & mut _ , promoted| {
168
168
let mir: & mut Mir < ' _ > = mir;
169
169
@@ -178,7 +178,7 @@ pub macro run_passes(
178
178
let mut index = 0 ;
179
179
let mut run_pass = |pass : & dyn MirPass | {
180
180
let run_hooks = |mir : & _ , index, is_after| {
181
- dump_mir:: on_mir_pass ( $tcx, & format_args ! ( "{:03}-{:03}" , suite_index , index) ,
181
+ dump_mir:: on_mir_pass ( $tcx, & format_args ! ( "{:03}-{:03}" , phase_index , index) ,
182
182
& pass. name ( ) , source, mir, is_after) ;
183
183
} ;
184
184
run_hooks ( mir, index, false ) ;
@@ -207,7 +207,7 @@ fn mir_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx Stea
207
207
let _ = tcx. unsafety_check_result ( def_id) ;
208
208
209
209
let mut mir = tcx. mir_built ( def_id) . steal ( ) ;
210
- run_passes ! [ tcx, mir, def_id, 0 , MirPhase :: Const ;
210
+ run_passes ! [ tcx, mir, def_id, MirPhase :: Const ;
211
211
// Remove all `EndRegion` statements that are not involved in borrows.
212
212
cleanup_post_borrowck:: CleanEndRegions ,
213
213
@@ -229,7 +229,7 @@ fn mir_validated<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx
229
229
}
230
230
231
231
let mut mir = tcx. mir_const ( def_id) . steal ( ) ;
232
- run_passes ! [ tcx, mir, def_id, 1 , MirPhase :: Validated ;
232
+ run_passes ! [ tcx, mir, def_id, MirPhase :: Validated ;
233
233
// What we need to run borrowck etc.
234
234
qualify_consts:: QualifyAndPromoteConstants ,
235
235
simplify:: SimplifyCfg :: new( "qualify-consts" ) ,
@@ -247,7 +247,7 @@ fn optimized_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx
247
247
}
248
248
249
249
let mut mir = tcx. mir_validated ( def_id) . steal ( ) ;
250
- run_passes ! [ tcx, mir, def_id, 2 , MirPhase :: Optimized ;
250
+ run_passes ! [ tcx, mir, def_id, MirPhase :: Optimized ;
251
251
// Remove all things not needed by analysis
252
252
no_landing_pads:: NoLandingPads ,
253
253
simplify_branches:: SimplifyBranches :: new( "initial" ) ,
0 commit comments