diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-07-14 20:57:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-14 20:57:14 -0700 |
| commit | c3a8347349fcde088f8dffaa0467ba77ccb5b4de (patch) | |
| tree | 6e876294b5325a42a692ef504b29937de89e56d0 /src | |
| parent | e7a9f1b626455d51c2804692f2e7c1ea4f22d78e (diff) | |
| parent | 0cf8f85275a969fe1d24c1700515659d09038ae3 (diff) | |
| download | rust-c3a8347349fcde088f8dffaa0467ba77ccb5b4de.tar.gz rust-c3a8347349fcde088f8dffaa0467ba77ccb5b4de.zip | |
Rollup merge of #43145 - GuillaumeGomez:build-error-if-nothing, r=Mark-Simulacrum
fail in case nothing to run was found Fixes #43121. r? @Mark-Simulacrum
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/step.rs | 11 |
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, _)| { |
