]> git.lizzy.rs Git - rust.git/commitdiff
Tweak assertion note in fmt
authorYuki Okushi <huyuumi.dev@gmail.com>
Mon, 13 Jan 2020 19:44:57 +0000 (04:44 +0900)
committerYuki Okushi <huyuumi.dev@gmail.com>
Mon, 13 Jan 2020 22:09:15 +0000 (07:09 +0900)
src/bootstrap/format.rs

index 65b654fb51929ad8bd429821c3d10efe5c38273d..6e5e3fe07e7467065abd36bbef79a49863ce1c33 100644 (file)
@@ -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)]