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
This commit is contained in:
commit
c3a8347349
@ -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, _)| {
|
||||
|
Loading…
Reference in New Issue
Block a user