Skip to content

fix: rename rustfmt test modules to avoid case-insensitive path collisions#2

Open
cataggar wants to merge 1 commit intomainfrom
fix/case-insensitive-reorder-modules-warning
Open

fix: rename rustfmt test modules to avoid case-insensitive path collisions#2
cataggar wants to merge 1 commit intomainfrom
fix/case-insensitive-reorder-modules-warning

Conversation

@cataggar
Copy link
Copy Markdown
Owner

@cataggar cataggar commented Mar 31, 2026

Summary

Cloning the rust repo on case-insensitive filesystems (e.g. Windows, macOS) produces a git warning about colliding paths:

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'

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). The ABCD/abcd and ZYXW/zyxw directories test case-sensitive module sorting — Edition ≤ 2021 uses str::cmp (ASCII order) while Edition ≥ 2024 uses version_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:

  • abcdabcde
  • zyxwzyxwv

All 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

…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.
@cataggar cataggar force-pushed the fix/case-insensitive-reorder-modules-warning branch from 42fd95b to ce428cf Compare March 31, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cost-insensitive warning for git clone of rustfmt tests

1 participant