about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-29 16:26:23 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-29 16:26:23 +0200
commit638a52c789e92009cf26ed73a4a5bc597814fe7b (patch)
treec386f3977ab162ef0819be4ab605f437147dc54e
parent41f2b6b39e7526a28d50ff6918dda6de48add5e4 (diff)
downloadrust-638a52c789e92009cf26ed73a4a5bc597814fe7b.tar.gz
rust-638a52c789e92009cf26ed73a4a5bc597814fe7b.zip
Improve librustdoc error when a file creation/modification failed
-rw-r--r--src/librustdoc/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index e2682045ab4..058d9cc7c90 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -760,7 +760,9 @@ fn run_renderer<
                 tcx.dcx().struct_fatal(format!("couldn't generate documentation: {}", e.error));
             let file = e.file.display().to_string();
             if !file.is_empty() {
-                msg.note(format!("failed to create or modify \"{file}\""));
+                msg.note(format!("failed to create or modify {e}"));
+            } else {
+                msg.note(format!("failed to create or modify file: {e}"));
             }
             msg.emit();
         }