diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f8bf4ee3022e1..a03dd23b56bf3 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1918,7 +1918,8 @@ impl<'test> TestCx<'test> { fn dump_output_file(&self, out: &str, extension: &str) { let outfile = self.make_out_name(extension); - fs::write(outfile.as_std_path(), out).unwrap(); + fs::write(outfile.as_std_path(), out) + .unwrap_or_else(|err| panic!("failed to write {outfile}: {err:?}")); } /// Creates a filename for output with the given extension.