-
Notifications
You must be signed in to change notification settings - Fork 556
Refinement of Providers into Providers and ExternProviders #2469
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
Conversation
d44eeb1
to
07bfd00
Compare
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
07bfd00
to
e03ee80
Compare
first commit for ExternProviders
, second commit for the nit in #2465.
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.
and then make this a DefId
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.
@tshepang suggest to make it LocalDefId
. #2465 (comment)
I just went through the source code and realized that the key for local providers is pretty much LocalDefId
. Which one are we going to choose?
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.
only suggested that because I did not realize there is ExternProvider as well, which accepts DefId (and not LocalDefId)
either works for me... can always be adjusted later to mention both
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
788ffb5
to
23d77ab
Compare
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 read the code in rustc_metadata
related to the extern providers and added it to the new commit, but I'm not sure there are parts I wrote correctly, if you have time to look at it. Thanks @Noratrieb
Refined some vague concepts and pseudo-code in Query System
In the past, we only used vague concepts like local and extern to differentiate between different queries. however the code has more detailed
Providers
andExternProviders
to differentiate between them, so we should mention both of them in the documentation as well.It is also important to indicate that
rustc_middle::util::Providers
is made up ofProviders
andExternProviders
in the query mod.This PR also updates the example of registering a new Provider to consider
ExternProviders
.r? @tshepang