about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-07-10 16:27:46 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-07-11 10:44:19 +0200
commit0cf8f85275a969fe1d24c1700515659d09038ae3 (patch)
tree2a2e2f71127cb128d7cf550847c29440125e1775
parentd84693b93dae3958e3504f817face0184c5c3fdd (diff)
downloadrust-0cf8f85275a969fe1d24c1700515659d09038ae3.tar.gz
rust-0cf8f85275a969fe1d24c1700515659d09038ae3.zip
fail in case nothing to run was found
-rw-r--r--src/bootstrap/step.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index c221d707683..5a1ef818ccf 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -28,6 +28,7 @@
 
 use std::collections::{BTreeMap, HashSet, HashMap};
 use std::mem;
+use std::path::PathBuf;
 use std::process;
 
 use check::{self, TestKind};
@@ -1209,11 +1210,19 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
             if paths.len() == 0 && rule.default {
                 Some((rule, 0))
             } else {
-                paths.iter().position(|path| path.ends_with(rule.path))
+                paths.iter()
+                     .position(|path| path.ends_with(rule.path))
                      .map(|priority| (rule, priority))
             }
         }).collect();
 
+        if rules.is_empty() &&
+           !paths.get(0).unwrap_or(&PathBuf::new())
+                 .ends_with("nonexistent/path/to/trigger/cargo/metadata") {
+            println!("\nNothing to run...\n");
+            process::exit(1);
+        }
+
         rules.sort_by_key(|&(_, priority)| priority);
 
         rules.into_iter().flat_map(|(rule, _)| {