diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-09-22 22:25:42 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-09-24 12:01:57 +0200 |
| commit | 10bef56fff02ff1da8a0993f33e6d226882c5ccd (patch) | |
| tree | 7b49d269cb2961d282d4296144d4657957a0156f /src/bootstrap/builder.rs | |
| parent | cfff31bc833070a00578bd6178160aeed56f28ba (diff) | |
| download | rust-10bef56fff02ff1da8a0993f33e6d226882c5ccd.tar.gz rust-10bef56fff02ff1da8a0993f33e6d226882c5ccd.zip | |
Simplify explicit request check
Diffstat (limited to 'src/bootstrap/builder.rs')
| -rw-r--r-- | src/bootstrap/builder.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 0a6ed2f49b7..1f2109879d1 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1617,6 +1617,22 @@ impl<'a> Builder<'a> { // Only execute if it's supposed to run as default if desc.default && should_run.is_really_default() { self.ensure(step) } else { None } } + + /// Checks if any of the "should_run" paths is in the `Builder` paths. + pub(crate) fn was_invoked_explicitly<S: Step>(&'a self) -> bool { + let desc = StepDescription::from::<S>(); + let should_run = (desc.should_run)(ShouldRun::new(self)); + + for path in &self.paths { + if should_run.paths.iter().any(|s| s.has(path)) + && !desc.is_excluded(self, &PathSet::Suite(path.clone())) + { + return true; + } + } + + false + } } #[cfg(test)] |
