delegation: fix def path hash collision, add per parent disambiguators#153955
delegation: fix def path hash collision, add per parent disambiguators#153955aerooneqq wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
This is all pretty awful. What exactly definitions create collisions like this? Generic parameters? As I understand the small per-node disambiguator tables partially duplicate content from the big table. |
We generate new The difference between delegation and other Maybe we can create our own
From our side yes, when we create generic params, their def path data can be either
Big table which is Internally Given this underlying structure I also didn't want to iterate over all map to find delegation-related key-values, and I also didn't want to expose the possibility of traversal of whole This left me with an option that I implemented in this PR: for each delegation we create additional disambiguator which follows the main one and then stored in |
|
@rustbot ready To get feedback on the comments. |
This comment has been minimized.
This comment has been minimized.
fbb4d60 to
b9ef605
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR may be relevant: It solved the collision problem by adding new |
5c0e8e9 to
ef583eb
Compare
|
Some changes occurred in compiler/rustc_sanitizers cc @rcvalle |
This comment has been minimized.
This comment has been minimized.
ef583eb to
5b48d28
Compare
This comment has been minimized.
This comment has been minimized.
cd53e9f to
01d6692
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
r=me after squashing commits. |
|
Reminder, once the PR becomes ready for a review, use |
|
@cjgillot @oli-obk I think the approach from #143361 is not very scalable, because it leaks internal details like desugaring something during AST lowering into the stable mangling scheme. If we followed it in this PR, we'd need separate (I'll keep this PR open for a few days before approving.) |
571b91e to
23a9f3b
Compare
|
@rustbot ready |
23a9f3b to
5d9cfeb
Compare
|
Removed duplicated test for #143498. |
View all comments
This PR addresses the following delegation issues:
found DefPathHash collision between DefPath#153410 when generating newDefIds for generic parameters bysavingintroducing per owner disambiguators and transferring them to AST -> HIR lowering stageDisambiguatorStates from resolve stage and using them at AST -> HIR loweringNext it fixes the ICE which is connected to usingDUMMY_SPin delegation code, which was found during previous fixFinally, after those fixes the ICE: delegation:DefId::expect_local DefId(..) isn't local#143498 is also fixed, only bugs with propagating synthetic generic params are left.Fixes #153410. Part of #118212.
r? @petrochenkov