Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"));
Comment on lines +763 to +765
Copy link
Contributor

@notriddle notriddle Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg.note(format!("failed to create or modify {e}"));
} else {
msg.note(format!("failed to create or modify file: {e}"));
msg.note(format!("failed to create or modify \"{file}\": {e}"));
} else {
msg.note(format!("failed to create or modify file: {e}"));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's included in the error message if it contains a path, hence why I make the check to prevent displaying it twice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, sure. That makes sense.

}
msg.emit();
}
Expand Down
Loading