Trait compiler_builtins::int::HInt
source · pub(crate) trait HInt: Int {
type D: DInt<H = Self> + Int;
// Required methods
fn widen(self) -> Self::D;
fn zero_widen(self) -> Self::D;
fn widen_hi(self) -> Self::D;
fn zero_widen_mul(self, rhs: Self) -> Self::D;
fn widen_mul(self, rhs: Self) -> Self::D;
}
Expand description
Trait for integers half the bit width of another integer. This is implemented for all
primitives except for u128
, because it there is not a larger primitive.
Required Associated Types§
Required Methods§
sourcefn widen(self) -> Self::D
fn widen(self) -> Self::D
Widens (using default extension) the integer to have double bit width
sourcefn zero_widen(self) -> Self::D
fn zero_widen(self) -> Self::D
Widens (zero extension only) the integer to have double bit width. This is needed to get
around problems with associated type bounds (such as Int<Othersign: DInt>
) being unstable
sourcefn widen_hi(self) -> Self::D
fn widen_hi(self) -> Self::D
Widens the integer to have double bit width and shifts the integer into the higher bits
sourcefn zero_widen_mul(self, rhs: Self) -> Self::D
fn zero_widen_mul(self, rhs: Self) -> Self::D
Widening multiplication with zero widening. This cannot overflow.