Commit ee06e7d
authored
Rollup merge of rust-lang#127297 - the8472:path-new-hash, r=Nilstrieb
Improve std::Path's Hash quality by avoiding prefix collisions
This adds a bit rotation to the already existing state so that the same sequence of characters chunked at different offsets into separate path components results in different hashes.
The tests are from rust-lang#127255
Closes rust-lang#1272542 files changed
Lines changed: 44 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
3195 | | - | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
3196 | 3199 | | |
3197 | 3200 | | |
3198 | 3201 | | |
3199 | 3202 | | |
3200 | 3203 | | |
3201 | 3204 | | |
| 3205 | + | |
| 3206 | + | |
3202 | 3207 | | |
3203 | | - | |
3204 | 3208 | | |
3205 | 3209 | | |
3206 | 3210 | | |
| |||
3221 | 3225 | | |
3222 | 3226 | | |
3223 | 3227 | | |
| 3228 | + | |
| 3229 | + | |
3224 | 3230 | | |
3225 | | - | |
3226 | 3231 | | |
3227 | 3232 | | |
3228 | | - | |
| 3233 | + | |
3229 | 3234 | | |
3230 | 3235 | | |
3231 | 3236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1622 | 1636 | | |
1623 | 1637 | | |
1624 | 1638 | | |
| |||
1633 | 1647 | | |
1634 | 1648 | | |
1635 | 1649 | | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
1636 | 1664 | | |
1637 | 1665 | | |
1638 | 1666 | | |
1639 | 1667 | | |
1640 | 1668 | | |
1641 | 1669 | | |
1642 | 1670 | | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1643 | 1678 | | |
1644 | 1679 | | |
1645 | 1680 | | |
| |||
0 commit comments