Improve librustdoc error when a file creation/modification failed

This commit is contained in:
Guillaume Gomez
2025-08-29 16:26:23 +02:00
parent 41f2b6b39e
commit 638a52c789

View File

@@ -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();
}