Trait rustc_ap_rustc_span::HashStableContext[][src]

pub trait HashStableContext {
    fn hash_def_id(&mut self, _: DefId, hasher: &mut StableHasher);
fn expn_id_cache() -> &'static LocalKey<ExpnIdCache>;
fn hash_crate_num(&mut self, _: CrateNum, hasher: &mut StableHasher);
fn hash_spans(&self) -> bool;
fn byte_pos_to_line_and_col(
        &mut self,
        byte: BytePos
    ) -> Option<(Lrc<SourceFile>, usize, BytePos)>;
fn span_data_to_lines_and_cols(
        &mut self,
        span: &SpanData
    ) -> Option<(Lrc<SourceFile>, usize, BytePos, usize, BytePos)>; }

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 hash_def_id(&mut self, _: DefId, hasher: &mut StableHasher)[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_crate_num(&mut self, _: CrateNum, hasher: &mut StableHasher)[src]

fn hash_spans(&self) -> bool[src]

fn byte_pos_to_line_and_col(
    &mut self,
    byte: BytePos
) -> Option<(Lrc<SourceFile>, usize, BytePos)>
[src]

fn span_data_to_lines_and_cols(
    &mut self,
    span: &SpanData
) -> Option<(Lrc<SourceFile>, usize, BytePos, usize, BytePos)>
[src]

Loading content...

Implementors

Loading content...