rustc_trait_selection::infer::canonical::ir

Trait TyEncoder

pub trait TyEncoder: SpanEncoder {
    type I: Interner;

    const CLEAR_CROSS_CRATE: bool;

    // Required methods
    fn position(&self) -> usize;
    fn type_shorthands(
        &mut self,
    ) -> &mut HashMap<<Self::I as Interner>::Ty, usize, FxBuildHasher>;
    fn predicate_shorthands(
        &mut self,
    ) -> &mut HashMap<PredicateKind<Self::I>, usize, FxBuildHasher>;
    fn encode_alloc_id(&mut self, alloc_id: &<Self::I as Interner>::AllocId);
}

Required Associated Constants§

Required Associated Types§

type I: Interner

Required Methods§

fn position(&self) -> usize

fn type_shorthands( &mut self, ) -> &mut HashMap<<Self::I as Interner>::Ty, usize, FxBuildHasher>

fn predicate_shorthands( &mut self, ) -> &mut HashMap<PredicateKind<Self::I>, usize, FxBuildHasher>

fn encode_alloc_id(&mut self, alloc_id: &<Self::I as Interner>::AllocId)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, 'tcx> TyEncoder for CacheEncoder<'a, 'tcx>

Source§

const CLEAR_CROSS_CRATE: bool = false

Source§

type I = TyCtxt<'tcx>

Source§

fn position(&self) -> usize

Source§

fn type_shorthands(&mut self) -> &mut HashMap<Ty<'tcx>, usize, FxBuildHasher>

Source§

fn predicate_shorthands( &mut self, ) -> &mut HashMap<PredicateKind<TyCtxt<'tcx>>, usize, FxBuildHasher>

Source§

fn encode_alloc_id(&mut self, alloc_id: &AllocId)

Implementors§