diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-01-14 14:02:31 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-14 14:02:31 +0900 |
| commit | b8c0e3129c0db858226f48406f6f8cb6f2a2b066 (patch) | |
| tree | 8fe9c20096ddf75571b4e9ff94a929858a4da40e | |
| parent | 7d1cbc7f7cb36eb6148c4bda5528882a3b278449 (diff) | |
| parent | d975228cedeaab828e91ab72d4d6fb5ded324de8 (diff) | |
| download | rust-b8c0e3129c0db858226f48406f6f8cb6f2a2b066.tar.gz rust-b8c0e3129c0db858226f48406f6f8cb6f2a2b066.zip | |
Rollup merge of #68188 - JohnTitor:tweak-assertion-note, r=Mark-Simulacrum
Tweak assertion note in format check It's informative to tell the existence of `--bless` flag if we're running `tidy`.
| -rw-r--r-- | src/bootstrap/format.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs index 65b654fb519..6e5e3fe07e7 100644 --- a/src/bootstrap/format.rs +++ b/src/bootstrap/format.rs @@ -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)] |
