Skip to content

Commit

Permalink
Rollup merge of #68188 - JohnTitor:tweak-assertion-note, r=Mark-Simul…
Browse files Browse the repository at this point in the history
…acrum

Tweak assertion note in format check

It's informative to tell the existence of `--bless` flag if we're running `tidy`.
  • Loading branch information
JohnTitor committed Jan 14, 2020
2 parents 7d1cbc7 + d975228 commit b8c0e31
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bootstrap/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ fn rustfmt(src: &Path, rustfmt: &Path, path: &Path, check: bool) {
cmd.arg(&path);
let cmd_debug = format!("{:?}", cmd);
let status = cmd.status().expect("executing rustfmt");
assert!(status.success(), "running {} successful", cmd_debug);
if !status.success() {
eprintln!(
"Running `{}` failed.\nIf you're running `tidy`, \
try again with `--bless` flag. Or, you just want to format \
code, run `./x.py fmt` instead.",
cmd_debug,
);
std::process::exit(1);
}
}

#[derive(serde::Deserialize)]
Expand Down

0 comments on commit b8c0e31

Please sign in to comment.