Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fmt): add the file path to the panic messages when formatting is unstable #15693

Merged
merged 1 commit into from Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions cli/tools/fmt.rs
Expand Up @@ -454,8 +454,9 @@ fn format_ensure_stable(
"Formatting succeeded initially, but failed when ensuring a ",
"stable format. This indicates a bug in the formatter where ",
"the text it produces is not syntatically correct. As a temporary ",
"workfaround you can ignore this file.\n\n{:#}"
"workfaround you can ignore this file ({}).\n\n{:#}"
),
file_path.display(),
err,
)
}
Expand All @@ -465,10 +466,11 @@ fn format_ensure_stable(
panic!(
concat!(
"Formatting not stable. Bailed after {} tries. This indicates a bug ",
"in the formatter where it formats the file differently each time. As a ",
"in the formatter where it formats the file ({}) differently each time. As a ",
"temporary workaround you can ignore this file."
),
count
count,
file_path.display(),
)
}
}
Expand Down