about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-06 10:03:24 +0200
committerGitHub <noreply@github.com>2025-07-06 10:03:24 +0200
commit097efc07cc13d8f6a3e04fe2a045b8a3ad6fd576 (patch)
tree10285b8d090e62d5ca144a2dc9d7e3bfd785b1bc /src/tools/compiletest
parente25654fb94c6438749c1cfa7781f73128c367bbe (diff)
parent9c9c5b041b807ddef7d34d128b15ed10c55e751b (diff)
downloadrust-097efc07cc13d8f6a3e04fe2a045b8a3ad6fd576.tar.gz
rust-097efc07cc13d8f6a3e04fe2a045b8a3ad6fd576.zip
Rollup merge of #143504 - RalfJung:compiletest-err, r=jieyouxu
compiletest: print slightly more information on fs::write failure

See [#t-infra > compiletest: panic in dump_output_file: No such file or dire @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/compiletest.3A.20panic.20in.20dump_output_file.3A.20No.20such.20file.20or.20dire/near/527294714)
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 0b07bb4da9b..3e879e0e4bb 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1924,7 +1924,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.