Fix delegation def path hash collision#153955
Fix delegation def path hash collision#153955aerooneqq wants to merge 1 commit intorust-lang:mainfrom
Conversation
| | ^^^ | ||
| | | | ||
| | expected at most 2 generic arguments | ||
| | help: remove the unnecessary generic argument |
There was a problem hiding this comment.
The new span for this help is a regression. It no longer points to any generic argument anymore.
| #![allow(incomplete_features)] | ||
|
|
||
| impl X { | ||
| //~^ ERROR: cannot find type `X` in this scope |
There was a problem hiding this comment.
Nit: an off-topic error, if it can removed by adding struct X; without harming the reproduction, then it's better to do it.
|
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 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. |
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 PR addresses the following delegation issues:
found DefPathHash collision between DefPath#153410 when generating newDefIds for generic parameters by savingDisambiguatorStates from resolve stage and using them at AST -> HIR loweringDUMMY_SPin delegation code, which was found during previous fixDefId::expect_local DefId(..) isn't local#143498 is also fixed, only bugs with propagating synthetic generic params are left.Fixes #153410. Fixes #143498. Part of #118212.
r? @petrochenkov
DUMMY_SP related ICE