We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5bbbc09 + 0c8c38f commit b8eba60Copy full SHA for b8eba60
src/bootstrap/src/core/builder/mod.rs
@@ -258,11 +258,11 @@ impl PathSet {
258
259
// internal use only
260
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
- }
+ 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() }
266
}
267
268
/// Return all `TaskPath`s in `Self` that contain any of the `needles`, removing the
0 commit comments