-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Investigate computing crate_hash by hashing metadata #94878
Copy link
Copy link
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The
crate_hashquery 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:
StableHasherand aStableHashingContextinrustc_metadata::rmeta::encoder::EncodeContext;opaqueencoder by a call tohash_stablewith the same data;CrateNum,DefId,LocalDefId...);crate_hashquery inrustc_middle::hir::map, and reimplement it from the just-encoded metadata;Please reach out on zulip if more details are required.
cc @michaelwoerister