Skip to main content

HashStableContext

Trait HashStableContext 

Source
pub trait HashStableContext {
    // Required methods
    fn span_hash_stable(&mut self, span: Span, hasher: &mut StableHasher);
    fn def_path_hash(&self, def_id: DefId) -> DefPathHash;
    fn assert_default_hashing_controls(&self, msg: &str);
}
Expand description

Requirements for a StableHashingContext to be used in this crate.

This is a hack to allow using the [HashStable_Generic] derive macro instead of implementing everything in rustc_middle.

Required Methods§

Source

fn span_hash_stable(&mut self, span: Span, hasher: &mut StableHasher)

The main event: stable hashing of a span.

Source

fn def_path_hash(&self, def_id: DefId) -> DefPathHash

Compute a DefPathHash.

Source

fn assert_default_hashing_controls(&self, msg: &str)

Assert that the provided HashStableContext is configured with the default HashingControls. We should always have bailed out before getting to here with a

Implementors§