@@ -2478,6 +2478,15 @@ impl<'test> TestCx<'test> {
2478
2478
}
2479
2479
}
2480
2480
2481
+ let set_mir_dump_dir = |rustc : & mut Command | {
2482
+ let mir_dump_dir = self . get_mir_dump_dir ( ) ;
2483
+ remove_and_create_dir_all ( & mir_dump_dir) ;
2484
+ let mut dir_opt = "-Zdump-mir-dir=" . to_string ( ) ;
2485
+ dir_opt. push_str ( mir_dump_dir. to_str ( ) . unwrap ( ) ) ;
2486
+ debug ! ( "dir_opt: {:?}" , dir_opt) ;
2487
+ rustc. arg ( dir_opt) ;
2488
+ } ;
2489
+
2481
2490
match self . config . mode {
2482
2491
Incremental => {
2483
2492
// If we are extracting and matching errors in the new
@@ -2532,13 +2541,7 @@ impl<'test> TestCx<'test> {
2532
2541
] ) ;
2533
2542
}
2534
2543
2535
- let mir_dump_dir = self . get_mir_dump_dir ( ) ;
2536
- remove_and_create_dir_all ( & mir_dump_dir) ;
2537
- let mut dir_opt = "-Zdump-mir-dir=" . to_string ( ) ;
2538
- dir_opt. push_str ( mir_dump_dir. to_str ( ) . unwrap ( ) ) ;
2539
- debug ! ( "dir_opt: {:?}" , dir_opt) ;
2540
-
2541
- rustc. arg ( dir_opt) ;
2544
+ set_mir_dump_dir ( & mut rustc) ;
2542
2545
}
2543
2546
CoverageMap => {
2544
2547
rustc. arg ( "-Cinstrument-coverage" ) ;
@@ -2560,8 +2563,11 @@ impl<'test> TestCx<'test> {
2560
2563
Assembly | Codegen => {
2561
2564
rustc. arg ( "-Cdebug-assertions=no" ) ;
2562
2565
}
2566
+ Crashes => {
2567
+ set_mir_dump_dir ( & mut rustc) ;
2568
+ }
2563
2569
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
2564
- | CodegenUnits | JsDocTest | Crashes => {
2570
+ | CodegenUnits | JsDocTest => {
2565
2571
// do not use JSON output
2566
2572
}
2567
2573
}
0 commit comments