Auto merge of #125032 - compiler-errors:crash-dump-dir, r=onur-ozkan
Make crashes dump mir to build dir Set `-Zdump-mir-dir` for `crashes`-style tests. Alternatively, we just remove `tests/crashes/124436.rs`, since if the only way to get it to repro is via `-Zdump-mir`, then maybe it's not worth it to fix. Fixes #125029
This commit is contained in:
commit
a71c3ffce9
@ -2478,6 +2478,15 @@ impl<'test> TestCx<'test> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let set_mir_dump_dir = |rustc: &mut Command| {
|
||||||
|
let mir_dump_dir = self.get_mir_dump_dir();
|
||||||
|
remove_and_create_dir_all(&mir_dump_dir);
|
||||||
|
let mut dir_opt = "-Zdump-mir-dir=".to_string();
|
||||||
|
dir_opt.push_str(mir_dump_dir.to_str().unwrap());
|
||||||
|
debug!("dir_opt: {:?}", dir_opt);
|
||||||
|
rustc.arg(dir_opt);
|
||||||
|
};
|
||||||
|
|
||||||
match self.config.mode {
|
match self.config.mode {
|
||||||
Incremental => {
|
Incremental => {
|
||||||
// If we are extracting and matching errors in the new
|
// If we are extracting and matching errors in the new
|
||||||
@ -2532,13 +2541,7 @@ impl<'test> TestCx<'test> {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mir_dump_dir = self.get_mir_dump_dir();
|
set_mir_dump_dir(&mut rustc);
|
||||||
remove_and_create_dir_all(&mir_dump_dir);
|
|
||||||
let mut dir_opt = "-Zdump-mir-dir=".to_string();
|
|
||||||
dir_opt.push_str(mir_dump_dir.to_str().unwrap());
|
|
||||||
debug!("dir_opt: {:?}", dir_opt);
|
|
||||||
|
|
||||||
rustc.arg(dir_opt);
|
|
||||||
}
|
}
|
||||||
CoverageMap => {
|
CoverageMap => {
|
||||||
rustc.arg("-Cinstrument-coverage");
|
rustc.arg("-Cinstrument-coverage");
|
||||||
@ -2560,8 +2563,11 @@ impl<'test> TestCx<'test> {
|
|||||||
Assembly | Codegen => {
|
Assembly | Codegen => {
|
||||||
rustc.arg("-Cdebug-assertions=no");
|
rustc.arg("-Cdebug-assertions=no");
|
||||||
}
|
}
|
||||||
|
Crashes => {
|
||||||
|
set_mir_dump_dir(&mut rustc);
|
||||||
|
}
|
||||||
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
|
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
|
||||||
| CodegenUnits | JsDocTest | Crashes => {
|
| CodegenUnits | JsDocTest => {
|
||||||
// do not use JSON output
|
// do not use JSON output
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user