add IntTypeTrait::literal utility function
This commit is contained in:
parent
8ca0cd56c4
commit
bdfa18e11d
|
@ -887,6 +887,15 @@ pub trait IntTypeTrait:
|
|||
CanonicalType = DynSIntType,
|
||||
CanonicalValue = DynSInt,
|
||||
>;
|
||||
fn literal(self, value: impl Into<BigInt>) -> Expr<IntValue<Self>>
|
||||
where
|
||||
Self: IntTypeTrait<
|
||||
CanonicalType = DynIntType<<Self as IntTypeTrait>::Signed>,
|
||||
CanonicalValue = DynInt<<Self as IntTypeTrait>::Signed>,
|
||||
>,
|
||||
{
|
||||
IntValue::with_type(self, value).to_expr()
|
||||
}
|
||||
fn from_width_unchecked(width: usize) -> Self;
|
||||
fn width(self) -> usize;
|
||||
fn as_same_width_uint(self) -> Self::SameWidthUInt;
|
||||
|
|
Loading…
Reference in a new issue