Skip to content

Commit 9c9c5b0

Browse files
committed
compiletest: print slightly more information on fs::write failure
1 parent 6dec76f commit 9c9c5b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,8 @@ impl<'test> TestCx<'test> {
19181918

19191919
fn dump_output_file(&self, out: &str, extension: &str) {
19201920
let outfile = self.make_out_name(extension);
1921-
fs::write(outfile.as_std_path(), out).unwrap();
1921+
fs::write(outfile.as_std_path(), out)
1922+
.unwrap_or_else(|err| panic!("failed to write {outfile}: {err:?}"));
19221923
}
19231924

19241925
/// Creates a filename for output with the given extension.

0 commit comments

Comments
 (0)