Fix bootstrap submodule path prefix matching#158960
Conversation
|
What is |
It is not an actual directory/tool in the Rust repo. I used src/tools/cargo-vendor as a synthetic negative test case: it shares the string prefix src/tools/cargo, but it is a sibling-like path rather than a child path, so submodule_path_of_paths must not classify it as being inside the src/tools/cargo submodule. |
|
r? @clubby789 rustbot has assigned @clubby789. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
It took me a while to understand what is the actual fix, it's this line:
let path = Path::new(path);Not sure if we ever really ran into this in practice, but seems like a reasonable fix. Thank you!
@bors r+ rollup
…fix, r=Kobzol Fix bootstrap submodule path prefix matching Fixes bootstrap submodule detection to use path-component matching instead of raw string prefix matching. This prevents paths like src/tools/cargo-vendor from being treated as inside the src/tools/cargo submodule. Adds a regression test for sibling paths that only share a string prefix with a submodule path.
Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158541 (Move `std::io::Write` to `core::io`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158960 (Fix bootstrap submodule path prefix matching) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159036 (bootstrap: expand '@argfile' arguments to rustc shim)
Rollup merge of #158960 - kn1g78:fix-bootstrap-submodule-prefix, r=Kobzol Fix bootstrap submodule path prefix matching Fixes bootstrap submodule detection to use path-component matching instead of raw string prefix matching. This prevents paths like src/tools/cargo-vendor from being treated as inside the src/tools/cargo submodule. Adds a regression test for sibling paths that only share a string prefix with a submodule path.
Fixes bootstrap submodule detection to use path-component matching instead of raw string prefix matching.
This prevents paths like src/tools/cargo-vendor from being treated as inside the src/tools/cargo submodule.
Adds a regression test for sibling paths that only share a string prefix with a submodule path.