Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Delay interning errors to after validation #122684
Delay interning errors to after validation #122684
Changes from all commits
8c9cba2
d87e963
140c9e1
8b2a4f8
77fe9f0
126dcc6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this assertion be moved outside the
if nested { ... } else { ... }
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will never be an entry for nested statics. They have already been interned. I'll assert that there is no such entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I had not even noticed that this specifically checks the
alloc_map
. Why that? Is it possible to useget_alloc_mutability
instead and do this sanity check for all statics, nested or otherwise?The only thing that has not been interned here is the root alloc of a static, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use that as it actually fetches the allocation, and that will cause cycle errors for recursive statics
has a different
AllocId
for&S
than it has for the root allocation. The root allocation'sAllocId
will never be leaked, but we still need it for evaluating the static itself. While this case can be detected, mutually recursive statics are impossible to detect locally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused -- I thought we use the same AllocId for the return place as for the static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm right. No idea where the cycle errors are coming from then. I just tested it and they still occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you called
get_alloc_raw
or something like that, that's still querying the static so would lead to a cycle if it is the current static.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is an ICE fix as well it seems, nice. :D
This file was deleted.