Skip to content

Commit b1a72c0

Browse files
authored
Unrolled build for rust-lang#126157
Rollup merge of rust-lang#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 rust-lang/miri#3622.)
2 parents cfdb617 + e26e42f commit b1a72c0

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_middle/src/mir/interpret

1 file changed

+5
-0
lines changed

compiler/rustc_middle/src/mir/interpret/value.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ impl<Prov> Scalar<Prov> {
196196
Self::from_int(i, Size::from_bits(64))
197197
}
198198

199+
#[inline]
200+
pub fn from_i128(i: i128) -> Self {
201+
Self::from_int(i, Size::from_bits(128))
202+
}
203+
199204
#[inline]
200205
pub fn from_target_isize(i: i64, cx: &impl HasDataLayout) -> Self {
201206
Self::from_int(i, cx.data_layout().pointer_size)

0 commit comments

Comments
 (0)