rustc_infer::infer::canonical::ir::codec

Trait TyDecoder

source
pub trait TyDecoder: SpanDecoder {
    type I: Interner;

    const CLEAR_CROSS_CRATE: bool;

    // Required methods
    fn interner(&self) -> Self::I;
    fn cached_ty_for_shorthand<F>(
        &mut self,
        shorthand: usize,
        or_insert_with: F,
    ) -> <Self::I as Interner>::Ty
       where F: FnOnce(&mut Self) -> <Self::I as Interner>::Ty;
    fn with_position<F, R>(&mut self, pos: usize, f: F) -> R
       where F: FnOnce(&mut Self) -> R;
    fn decode_alloc_id(&mut self) -> <Self::I as Interner>::AllocId;

    // Provided method
    fn positioned_at_shorthand(&self) -> bool { ... }
}

Required Associated Constants§

Required Associated Types§

Required Methods§

source

fn interner(&self) -> Self::I

source

fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F, ) -> <Self::I as Interner>::Ty
where F: FnOnce(&mut Self) -> <Self::I as Interner>::Ty,

source

fn with_position<F, R>(&mut self, pos: usize, f: F) -> R
where F: FnOnce(&mut Self) -> R,

source

fn decode_alloc_id(&mut self) -> <Self::I as Interner>::AllocId

Provided Methods§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, 'tcx> TyDecoder for CacheDecoder<'a, 'tcx>

source§

const CLEAR_CROSS_CRATE: bool = false

source§

type I = TyCtxt<'tcx>

source§

fn interner(&self) -> TyCtxt<'tcx>

source§

fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F, ) -> Ty<'tcx>
where F: FnOnce(&mut CacheDecoder<'a, 'tcx>) -> Ty<'tcx>,

source§

fn with_position<F, R>(&mut self, pos: usize, f: F) -> R
where F: FnOnce(&mut CacheDecoder<'a, 'tcx>) -> R,

source§

fn decode_alloc_id(&mut self) -> AllocId

Implementors§