Skip to content

Commit b8eba60

Browse files
authored
Unrolled build for rust-lang#133492
Rollup merge of rust-lang#133492 - MarcoIeni:bootstrap-path-check, r=onur-ozkan bootstrap: allow skipping steps with start of path
2 parents 5bbbc09 + 0c8c38f commit b8eba60

File tree

1 file changed

+5
-5
lines changed
  • src/bootstrap/src/core/builder

1 file changed

+5
-5
lines changed

src/bootstrap/src/core/builder/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ impl PathSet {
258258

259259
// internal use only
260260
fn check(p: &TaskPath, needle: &Path, module: Kind) -> bool {
261-
if let Some(p_kind) = &p.kind {
262-
p.path.ends_with(needle) && *p_kind == module
263-
} else {
264-
p.path.ends_with(needle)
265-
}
261+
let check_path = || {
262+
// This order is important for retro-compatibility, as `starts_with` was introduced later.
263+
p.path.ends_with(needle) || p.path.starts_with(needle)
264+
};
265+
if let Some(p_kind) = &p.kind { check_path() && *p_kind == module } else { check_path() }
266266
}
267267

268268
/// Return all `TaskPath`s in `Self` that contain any of the `needles`, removing the

0 commit comments

Comments
 (0)