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)
This commit is contained in:
Matthias Krüger 2025-07-06 10:03:24 +02:00 committed by GitHub
commit 097efc07cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.