Add a TaggedQueryKey to identify a query instance#153492
Add a TaggedQueryKey to identify a query instance#153492Zoxc wants to merge 2 commits intorust-lang:mainfrom
TaggedQueryKey to identify a query instance#153492Conversation
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
If we can get rid of a lot of the QueryStackFrame complexity by just storing the query key in an enum, that seems great. The name |
Yeah, |
This comment has been minimized.
This comment has been minimized.
|
This looks great! I hate the deferred/extra split, this seems like a really clean way to eliminate it. @Zoxc: can you expand the first paragraph of the PR description to explain (a) the current situation, and (b) how this PR changes that situation? I've skimmed the changes and they look good, but I will need to look again more closely on Monday to get my head fully around how the new cc @zetanumbers |
I was thinking of something like I think it's easier to say “this is a key that also indicates what query it came from” than to try to come up with an intuitive name for query+key. Or we could go for something like |
|
|
|
Just a little more work required to get this into shape. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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. |
QueryKeyId to identify a query instanceTaggedQueryKey to identify a query instance
This adds back a
TaggedQueryKeyenum which represents a query kind and the associated key. This is used to replaceQueryStackDeferredandQueryStackFrameExtraand the associated lifting operation for cycle errorsThis approach has a couple of benefits:
QueryStackDeferredis removedSome further work could be replacing
QueryStackFramewithTaggedQueryKeyas the extra information can be derived from it.