Skip to content

Commit

Permalink
Rollup merge of rust-lang#43145 - GuillaumeGomez:build-error-if-nothi…
Browse files Browse the repository at this point in the history
…ng, r=Mark-Simulacrum

fail in case nothing to run was found

Fixes rust-lang#43121.

r? @Mark-Simulacrum
  • Loading branch information
frewsxcv committed Jul 15, 2017
2 parents e7a9f1b + 0cf8f85 commit c3a8347
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

use std::collections::{BTreeMap, HashSet, HashMap};
use std::mem;
use std::path::PathBuf;
use std::process;

use check::{self, TestKind};
Expand Down Expand Up @@ -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, _)| {
Expand Down

0 comments on commit c3a8347

Please sign in to comment.