fix: rename rustfmt test modules to avoid case-insensitive path collisions#2
Open
fix: rename rustfmt test modules to avoid case-insensitive path collisions#2
Conversation
…sions
Cloning the repo on Windows leads to this warning:
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'src/tools/rustfmt/tests/source/reorder_modules/ABCD/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/abcd/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/zyxw/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/abcd/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/zyxw/mod.rs'
Rename the lowercase variants (abcd -> abcde, zyxw -> zyxwv) to avoid
case-insensitive collisions while preserving test intent.
42fd95b to
ce428cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cloning the rust repo on case-insensitive filesystems (e.g. Windows, macOS) produces a git warning about colliding paths:
Why they were named this way
These were added by @calebcartwright in
2d049af8f0e(rust-lang/rustfmt#6368) and brought into this repo via the rustfmt subtree update (rust-lang#153145). TheABCD/abcdandZYXW/zyxwdirectories test case-sensitive module sorting — Edition ≤ 2021 usesstr::cmp(ASCII order) while Edition ≥ 2024 usesversion_sort. The collision on case-insensitive filesystems was not considered since development was on Linux.Fix
Rename the lowercase directory variants to avoid the collision:
abcd→abcdezyxw→zyxwvAll
mod abcd;/mod zyxw;declarations in the 10 affected test files are updated accordingly. This preserves the test intent (verifying case-sensitive module sorting across style editions) while eliminating the warning on case-insensitive filesystems.Fixes #1
Upstream PR: rust-lang#154639