diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-05 22:21:23 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-07-05 22:21:23 +0200 |
| commit | 9c9c5b041b807ddef7d34d128b15ed10c55e751b (patch) | |
| tree | d50264d28cae2453694fb230a80a23632629834c | |
| parent | 6dec76f1c2809fded082dd44d3752d3f6220d767 (diff) | |
| download | rust-9c9c5b041b807ddef7d34d128b15ed10c55e751b.tar.gz rust-9c9c5b041b807ddef7d34d128b15ed10c55e751b.zip | |
compiletest: print slightly more information on fs::write failure
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f8bf4ee3022..a03dd23b56b 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. |
