Trait rustc_ap_rustc_span::HashStableContext [−][src]
pub trait HashStableContext {
fn def_path_hash(&self, def_id: DefId) -> DefPathHash;
fn expn_id_cache() -> &'static LocalKey<ExpnIdCache>;
fn hash_spans(&self) -> bool;
fn span_data_to_lines_and_cols(
&mut self,
span: &SpanData
) -> Option<(Lrc<SourceFile>, usize, BytePos, usize, BytePos)>;
}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
fn def_path_hash(&self, def_id: DefId) -> DefPathHash[src]fn expn_id_cache() -> &'static LocalKey<ExpnIdCache>[src]
fn expn_id_cache() -> &'static LocalKey<ExpnIdCache>[src]Obtains a cache for storing the Fingerprint of an ExpnId.
This method allows us to have multiple HashStableContext implementations
that hash things in a different way, without the results of one polluting
the cache of the other.
fn hash_spans(&self) -> bool[src]