Skip to content

Commit

Permalink
Rollup merge of rust-lang#133492 - MarcoIeni:bootstrap-path-check, r=…
Browse files Browse the repository at this point in the history
…onur-ozkan

bootstrap: allow skipping steps with start of path
  • Loading branch information
matthiaskrgr authored Nov 29, 2024
2 parents f2de4f5 + 0c8c38f commit bfe7d98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfe7d98

Please sign in to comment.