-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The crate_hash query is used to detect is metadata has changed before attempting to decode more complex information from it.
Until now, this crate hash has been computed manually using HIR.
Computing it while encoding metadata itself may be more robust and exhaustive.
General instructions:
- add a
StableHasherand aStableHashingContextinrustc_metadata::rmeta::encoder::EncodeContext; - double all accesses to the embedded
opaqueencoder by a call tohash_stablewith the same data; - manually reimplement encoding and hashing for special datatypes (
CrateNum,DefId,LocalDefId...); - remove the implementation of the
crate_hashquery inrustc_middle::hir::map, and reimplement it from the just-encoded metadata; - evaluate effect on performance.
Please reach out on zulip if more details are required.
cc @michaelwoerister
Metadata
Metadata
Assignees
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.