about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/cargo-fmt.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/cargo-fmt.rs b/src/bin/cargo-fmt.rs
index 93a9326918c..3c3ce223318 100644
--- a/src/bin/cargo-fmt.rs
+++ b/src/bin/cargo-fmt.rs
@@ -203,6 +203,16 @@ fn format_files(files: &Vec<PathBuf>,
         .stdout(stdout)
         .args(files)
         .args(fmt_args)
-        .spawn());
+        .spawn()
+        .map_err(|e| {
+            match e.kind() {
+                std::io::ErrorKind::NotFound => {
+                    std::io::Error::new(std::io::ErrorKind::Other,
+                                        "Could not run rustfmt, please make sure it is in your \
+                                         PATH.")
+                }
+                _ => e,
+            }
+        }));
     command.wait()
 }