Skip to content

Commit d975228

Browse files
committed
Tweak assertion note in fmt
1 parent af95804 commit d975228

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/format.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ fn rustfmt(src: &Path, rustfmt: &Path, path: &Path, check: bool) {
2020
cmd.arg(&path);
2121
let cmd_debug = format!("{:?}", cmd);
2222
let status = cmd.status().expect("executing rustfmt");
23-
assert!(status.success(), "running {} successful", cmd_debug);
23+
if !status.success() {
24+
eprintln!(
25+
"Running `{}` failed.\nIf you're running `tidy`, \
26+
try again with `--bless` flag. Or, you just want to format \
27+
code, run `./x.py fmt` instead.",
28+
cmd_debug,
29+
);
30+
std::process::exit(1);
31+
}
2432
}
2533

2634
#[derive(serde::Deserialize)]

0 commit comments

Comments
 (0)