about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-29 10:18:57 +0100
committerGitHub <noreply@github.com>2024-11-29 10:18:57 +0100
commit95560d6fe758537594ece757ef7fba604dfee123 (patch)
tree7c77b91632a9316e83604d4ff94fbc13b4b685d4 /src/bootstrap
parent370fc132981a4d1944c3f492d142011c62c5a0ba (diff)
parent0c8c38fbc70799508ecac22e0d25b8f3338abcf5 (diff)
downloadrust-95560d6fe758537594ece757ef7fba604dfee123.tar.gz
rust-95560d6fe758537594ece757ef7fba604dfee123.zip
Rollup merge of #133492 - MarcoIeni:bootstrap-path-check, r=onur-ozkan
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 fa2ee7ffdca..73bc7195ac2 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