rustc_trait_selection::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§

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> 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§