Skip to main content

HygieneRemapper

Trait HygieneRemapper 

Source
pub trait HygieneRemapper<T> {
    // Required methods
    fn stable_hash(
        &self,
        t: T,
        hcx: &mut impl StableHashCtxt,
        hasher: &mut StableHasher,
    );
    fn len(&self) -> usize;
    fn first_non_det_index_mut(&mut self) -> &mut Option<T>;
    fn first_non_det_index(&self) -> u32;

    // Provided methods
    fn commit_end_of_determinism(&mut self)
       where T: From<u32> { ... }
    fn remapping_results(
        &self,
        hcx: &mut impl StableHashCtxt,
    ) -> HygieneRemappingResults<T>
       where T: From<u32> + Hash + Eq + Copy { ... }
}
Expand description

Includes common logic for remapping both expansion ids and syntax contexts. FIXME: this solution does not take into account syntax contexts and expansion ids that are allocated during metadata encoding, if we will have non-determinism there this remapping will not help as it is constructed before metadata encoding.

Required Methods§

Source

fn stable_hash( &self, t: T, hcx: &mut impl StableHashCtxt, hasher: &mut StableHasher, )

Source

fn len(&self) -> usize

Source

fn first_non_det_index_mut(&mut self) -> &mut Option<T>

Source

fn first_non_det_index(&self) -> u32

Provided Methods§

Source

fn commit_end_of_determinism(&mut self)
where T: From<u32>,

Source

fn remapping_results( &self, hcx: &mut impl StableHashCtxt, ) -> HygieneRemappingResults<T>
where T: From<u32> + Hash + Eq + Copy,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§