about summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-08-29 19:33:05 -0500
committerGitHub <noreply@github.com>2025-08-29 19:33:05 -0500
commitb722da955f8151edeef8b3fea498a43975441742 (patch)
tree717dc302438a94446f9539636cacfa8124968788 /src/librustdoc/lib.rs
parenta7fd14f89d1aea5cb979dcf1473abac74a1f8cc5 (diff)
parent638a52c789e92009cf26ed73a4a5bc597814fe7b (diff)
downloadrust-b722da955f8151edeef8b3fea498a43975441742.tar.gz
rust-b722da955f8151edeef8b3fea498a43975441742.zip
Rollup merge of #146000 - GuillaumeGomez:rustdoc-error-improvement, r=notriddle
Improve librustdoc error when a file creation/modification failed

The message before looks like this:

```
failed to create or modify "/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/"
```

And with this change it looks like this:

```
failed to create or modify "/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/": failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8
```

r? ``````@lolbinarycat``````
Diffstat (limited to 'src/librustdoc/lib.rs')
-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 cd29b096ccf..f62eba4b3c1 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();
         }