Rollup merge of #126157 - RalfJung:scalar-i128, r=compiler-errors
add missing Scalar::from_i128 We seem to have `from` methods for all primitive types except `i128`... let's complete the set of methods. (This came up in https://github.com/rust-lang/miri/pull/3622.)
This commit is contained in:
commit
7fd9b1ffd4
1 changed files with 5 additions and 0 deletions
|
@ -196,6 +196,11 @@ impl<Prov> Scalar<Prov> {
|
|||
Self::from_int(i, Size::from_bits(64))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_i128(i: i128) -> Self {
|
||||
Self::from_int(i, Size::from_bits(128))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_target_isize(i: i64, cx: &impl HasDataLayout) -> Self {
|
||||
Self::from_int(i, cx.data_layout().pointer_size)
|
||||
|
|
Loading…
Add table
Reference in a new issue