Skip to content

Commit 0cf8f85

Browse files
fail in case nothing to run was found
1 parent d84693b commit 0cf8f85

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bootstrap/step.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
2929
use std::collections::{BTreeMap, HashSet, HashMap};
3030
use std::mem;
31+
use std::path::PathBuf;
3132
use std::process;
3233

3334
use check::{self, TestKind};
@@ -1209,11 +1210,19 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
12091210
if paths.len() == 0 && rule.default {
12101211
Some((rule, 0))
12111212
} else {
1212-
paths.iter().position(|path| path.ends_with(rule.path))
1213+
paths.iter()
1214+
.position(|path| path.ends_with(rule.path))
12131215
.map(|priority| (rule, priority))
12141216
}
12151217
}).collect();
12161218

1219+
if rules.is_empty() &&
1220+
!paths.get(0).unwrap_or(&PathBuf::new())
1221+
.ends_with("nonexistent/path/to/trigger/cargo/metadata") {
1222+
println!("\nNothing to run...\n");
1223+
process::exit(1);
1224+
}
1225+
12171226
rules.sort_by_key(|&(_, priority)| priority);
12181227

12191228
rules.into_iter().flat_map(|(rule, _)| {

0 commit comments

Comments
 (0)