Commit 0c157e0
authored
simplify SourceID Hash (#14800)
### What does this PR try to resolve?
Despite being interned `SourceId::Eq` is not a `ptr::eq`. Which in turn
is because `SourceId`s concept of identity is a complete mess. The code
relies on having to IDs that are `Eq` but do not have the same values
for their fields.
As one measure of this `SourceId` has an `impl Hash` which does
something different from `fn full_hash` and `fn stable_hash`. Separately
`SourceIdInner` has a different implementation. Similar levels of
complexity exist for `Eq`. Every one of these `impl`s was added due to a
real bug/issue we've had that needs to stay fixed. Not all of witch are
reproducible enough to have made it into our test suite.
I [have some
ideas](#14665 (comment))
for how to reorganize the types so that this is easier to reason about
and faster. But given the history and the complexity I want to move
extremely carefully.
### How should we test and review this PR?
The test pass, and it's a one line change, but this still needs careful
review.
### Additional information
r? @ehuss I remember you and Alex working very hard to track down most
of these bugs.1 file changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
536 | 539 | | |
537 | 540 | | |
538 | 541 | | |
| |||
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
553 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
554 | 561 | | |
555 | 562 | | |
556 | 563 | | |
| |||
665 | 672 | | |
666 | 673 | | |
667 | 674 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | 675 | | |
672 | 676 | | |
673 | 677 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 678 | + | |
678 | 679 | | |
679 | 680 | | |
680 | 681 | | |
| |||
0 commit comments