summaryrefslogtreecommitdiff
path: root/cli/tools/fmt.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-08-30 14:46:03 -0400
committerGitHub <noreply@github.com>2022-08-30 14:46:03 -0400
commit79fe8ffff8f5032ed11df410c14acadfa1a74946 (patch)
treedb4f767f7d869b64a22a0b6d280bb6cfc653fc99 /cli/tools/fmt.rs
parent5f251b283b3532849862c7fdf4b91f0f9ed68829 (diff)
fix(fmt): add the file path to the panic messages when formatting is unstable (#15693)
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r--cli/tools/fmt.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index 334e46c34..584be9e6b 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -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,
)
}
@@ -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(),
)
}
}