rustc_middle::ty::layout

Trait PrimitiveExt

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

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

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§