Open
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
StableHasher
and aStableHashingContext
inrustc_metadata::rmeta::encoder::EncodeContext
; - double all accesses to the embedded
opaque
encoder by a call tohash_stable
with the same data; - manually reimplement encoding and hashing for special datatypes (
CrateNum
,DefId
,LocalDefId
...); - remove the implementation of the
crate_hash
query 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
Call for participation: Help is requested to fix this issue.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.