Skip to main content

Module stable_hasher

Module stable_hasher 

Source

Macros§

impl_stable_traits_for_trivial_type 🔒
Implement HashStable by just calling Hash::hash(). Also implement StableOrd for the type since that has the same requirements.

Structs§

HashingControls
Controls what data we do or do not hash. Whenever a HashStable implementation caches its result, it needs to include HashingControls as part of the key, to ensure that it does not produce an incorrect result (for example, using a Fingerprint produced while hashing Spans when a Fingerprint without Spans is being requested)
RawDefId
RawDefPathHash
RawSpan
StableHasherHash
Hashing result of SipHasher128

Traits§

FromStableHash
Trait for processing the result of the stable hashing operation.
HashStable
Something that implements HashStable can be hashed in a way that is stable across multiple compilation sessions.
HashStableContext
This trait lets HashStable and derive(HashStable) be used in this crate (and other crates upstream of rustc_middle), while leaving certain operations to be defined in rustc_middle where more things are visible.
StableCompare
This is a companion trait to StableOrd. Some types like Symbol can be compared in a cross-session stable way, but their Ord implementation is not stable. In such cases, a StableOrd implementation can be provided to offer a lightweight way for stable sorting. (The more heavyweight option is to sort via ToStableHashKey, but then sorting needs to have access to a stable hashing context and ToStableHashKey can also be expensive as in the case of Symbol where it has to allocate a String.)
StableOrd
Trait for marking a type as having a sort order that is stable across compilation session boundaries. More formally:
ToStableHashKey
Implement this for types that can be turned into stable keys like, for example, for DefId that can be converted to a DefPathHash. This is used for bringing maps into a predictable order before hashing them.

Type Aliases§

StableHasher
Stable 128-bits Sip Hasher