Support a few more rvalues.
This commit is contained in:
parent
7ef555d84a
commit
74a967bcec
28 changed files with 835 additions and 33 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue