1
Fork 0

Support a few more rvalues.

This commit is contained in:
Camille GILLOT 2023-04-15 16:41:57 +00:00
parent 7ef555d84a
commit 74a967bcec
28 changed files with 835 additions and 33 deletions

View file

@ -226,6 +226,11 @@ impl ScalarInt {
}
}
#[inline]
pub fn try_from_target_usize(i: impl Into<u128>, tcx: TyCtxt<'_>) -> Option<Self> {
Self::try_from_uint(i, tcx.data_layout.pointer_size)
}
#[inline]
pub fn assert_bits(self, target_size: Size) -> u128 {
self.to_bits(target_size).unwrap_or_else(|size| {