Skip to content
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

internal: Build source map for hir_def::TypeRefs #18074

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Sep 8, 2024

So that given a TypeRef we will be able to trace it back to source code.

This is necessary to be able to provide diagnostics for lowering to chalk tys, since the input to that is TypeRef. This is the first step towards diagnostics for ty lowering. The next steps will be smaller :P

This means that TypeRefs now have an identity, which means storing them in arena and not interning them, which is an unfortunate (but necessary) loss but also a pretty massive change. Luckily, because of the separation layer we have for IDE and HIR, this change never crosses the IDE boundary.

This gives an unfortunate regression of ~170mb in analysis-stats ..

Sorry for the size of the PR; I did some extra things but they are trivial - most of the code is necessary and impossible to split.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2024
@ChayimFriedman2 ChayimFriedman2 marked this pull request as draft September 8, 2024 19:28
@bors
Copy link
Collaborator

bors commented Sep 11, 2024

☔ The latest upstream changes (presumably #18075) made this pull request unmergeable. Please resolve the merge conflicts.

So that given a `TypeRef` we will be able to trace it back to source code.

This is necessary to be able to provide diagnostics for lowering to chalk tys, since the input to that is `TypeRef`.

This means that `TypeRef`s now have an identity, which means storing them in arena and not interning them, which is an unfortunate (but necessary) loss but also a pretty massive change. Luckily, because of the separation layer we have for IDE and HIR, this change never crosses the IDE boundary.
@ChayimFriedman2 ChayimFriedman2 marked this pull request as ready for review September 12, 2024 21:44
@ChayimFriedman2
Copy link
Contributor Author

Okay, this is ready for review.

I intend to submit a follow-up PR with few cleanups that I don't want to insert here to not increase the size of this already-large PR.

@ChayimFriedman2 ChayimFriedman2 changed the title Build source map for hir_def::TypeRefs internal: Build source map for hir_def::TypeRefs Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants