-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some assorted region hashing fixes. #43743
Conversation
This will break |
No it shouldn't because all regions are erased when computing the |
But maybe I read the corresponding RFC wrong and TypeId should act as if everything was anonymized instead of erased? |
@michaelwoerister Are you saying |
I see that that's a problem -- yet the |
@michaelwoerister That's completely different from |
But if we did not have the |
@michaelwoerister Correct. |
d608abf
to
dfa5435
Compare
I changed the last commit to just call |
@michaelwoerister I still see a removed |
@eddyb Yes, the one in |
@michaelwoerister Okay can you make sure we still produce the same |
dfa5435
to
6dbd846
Compare
Done! |
r=me I guess (if the test passes) |
📌 Commit 6dbd846 has been approved by |
Some assorted region hashing fixes. This PR contains three changes. 1. It changes what we implement `HashStable` for. Previously, the trait was implemented for things in the local `TyCtxt`. That was OK, since we only invoked hashing with a `TyCtxt<'_, 'tcx, 'tcx>` where there is no difference. With query result hashing this becomes a problem though. So we now implement `HashStable` for things in `'gcx`. 2. The PR makes the regular `HashStable` implementation *not* anonymize late-bound regions anymore. It's a waste of computing resources and it's not clear that it would always be correct to do so. 3. The PR adds an option for stable hashing to treat all regions as erased and uses this new option when computing the `TypeId`. This should help with #41875. I did not add a test case for (3) since that's not possible yet. But it looks like @zackmdavis has something in the pipeline there `:)`. r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
This PR contains three changes.
HashStable
for. Previously, the trait was implemented for things in the localTyCtxt
. That was OK, since we only invoked hashing with aTyCtxt<'_, 'tcx, 'tcx>
where there is no difference. With query result hashing this becomes a problem though. So we now implementHashStable
for things in'gcx
.HashStable
implementation not anonymize late-bound regions anymore. It's a waste of computing resources and it's not clear that it would always be correct to do so.TypeId
. This should help with Tracking issue for non_static_type_id #41875.I did not add a test case for (3) since that's not possible yet. But it looks like @zackmdavis has something in the pipeline there
:)
.r? @eddyb