[−][src]Trait rustc_middle::ty::layout::IntegerExt

pub trait IntegerExt {
    pub fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>, signed: bool) -> Ty<'tcx>;
pub fn from_attr<C: HasDataLayout>(cx: &C, ity: IntType) -> Integer;
pub fn repr_discr<'tcx>(
        tcx: TyCtxt<'tcx>,
        ty: Ty<'tcx>,
        repr: &ReprOptions,
        min: i128,
        max: i128
    ) -> (Integer, bool); }

Required methods

pub fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>, signed: bool) -> Ty<'tcx>[src]

pub fn from_attr<C: HasDataLayout>(cx: &C, ity: IntType) -> Integer[src]

pub fn repr_discr<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    repr: &ReprOptions,
    min: i128,
    max: i128
) -> (Integer, bool)
[src]

Loading content...

Implementations on Foreign Types

impl IntegerExt for Integer[src]

pub fn from_attr<C: HasDataLayout>(cx: &C, ity: IntType) -> Integer[src]

Gets the Integer type from an attr::IntType.

pub fn repr_discr<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    repr: &ReprOptions,
    min: i128,
    max: i128
) -> (Integer, bool)
[src]

Finds the appropriate Integer type and signedness for the given signed discriminant range and #[repr] attribute. N.B.: u128 values above i128::MAX will be treated as signed, but that shouldn't affect anything, other than maybe debuginfo.

Loading content...

Implementors

Loading content...