pub trait PrimitiveExt {
    // Required methods
    fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>;
    fn to_int_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>;
}

Required Methods§

source

fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

source

fn to_int_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Implementations on Foreign Types§

source§

impl PrimitiveExt for Primitive

source§

fn to_int_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Return an integer type matching this primitive. Useful in particular when dealing with enum discriminants.

source§

fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Implementors§