about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMarcoIeni <11428655+MarcoIeni@users.noreply.github.com>2024-11-28 09:03:07 +0100
committerMarcoIeni <11428655+MarcoIeni@users.noreply.github.com>2024-11-28 09:03:07 +0100
commit0c8c38fbc70799508ecac22e0d25b8f3338abcf5 (patch)
tree2a26e7ed9826bb0c32ceccc7063ec6b23405b637 /src/bootstrap
parentf2abf827c128120ed7a874d02973947968c158b8 (diff)
downloadrust-0c8c38fbc70799508ecac22e0d25b8f3338abcf5.tar.gz
rust-0c8c38fbc70799508ecac22e0d25b8f3338abcf5.zip
bootstrap: allow skipping steps with start of path
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/builder/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index d59e0fa7288..114b5d1cf60 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -258,11 +258,11 @@ impl PathSet {
 
     // internal use only
     fn check(p: &TaskPath, needle: &Path, module: Kind) -> bool {
-        if let Some(p_kind) = &p.kind {
-            p.path.ends_with(needle) && *p_kind == module
-        } else {
-            p.path.ends_with(needle)
-        }
+        let check_path = || {
+            // This order is important for retro-compatibility, as `starts_with` was introduced later.
+            p.path.ends_with(needle) || p.path.starts_with(needle)
+        };
+        if let Some(p_kind) = &p.kind { check_path() && *p_kind == module } else { check_path() }
     }
 
     /// Return all `TaskPath`s in `Self` that contain any of the `needles`, removing the