diff options
| author | Ralf Jung <post@ralfj.de> | 2024-06-08 14:48:32 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-06-08 14:48:32 +0200 |
| commit | e26e42fabee2c3dc2060fbfe03856f8ab16eb762 (patch) | |
| tree | c658c76d14ad7d99b2afe1f4f5bf18aadc914cac /compiler/rustc_middle/src | |
| parent | 655600c5cba4d1e76fa0652c72258ec4996f48b8 (diff) | |
add missing Scalar::from_i128
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/value.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/value.rs b/compiler/rustc_middle/src/mir/interpret/value.rs index c5c87c506b7..85357265687 100644 --- a/compiler/rustc_middle/src/mir/interpret/value.rs +++ b/compiler/rustc_middle/src/mir/interpret/value.rs @@ -197,6 +197,11 @@ impl<Prov> Scalar<Prov> { } #[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) } |
