From 638a52c789e92009cf26ed73a4a5bc597814fe7b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 29 Aug 2025 16:26:23 +0200 Subject: [PATCH] Improve librustdoc error when a file creation/modification failed --- src/librustdoc/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index e2682045ab432..058d9cc7c90cb 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(); }