diff options
| author | oli <github35764891676564198441@oli-obk.de> | 2020-11-04 13:59:11 +0000 |
|---|---|---|
| committer | oli <github35764891676564198441@oli-obk.de> | 2020-11-04 13:59:11 +0000 |
| commit | 6e96e10f9363dc792acb02ff616aaca36764805d (patch) | |
| tree | 168b60cc301dc49a08b20f084e387fca72935a07 | |
| parent | 5fa1c8f91a046b8e84443c93214d5f0e0df67eee (diff) | |
| download | rust-6e96e10f9363dc792acb02ff616aaca36764805d.tar.gz rust-6e96e10f9363dc792acb02ff616aaca36764805d.zip | |
`u64::try_from` will now fail if `ScalarInt` isn't exactly 64 bits, thus we use `to_bits` with the correct size
| -rw-r--r-- | src/value_and_place.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/value_and_place.rs b/src/value_and_place.rs index a40686b1931..0000866c4f6 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -261,7 +261,7 @@ impl<'tcx> CValue<'tcx> { fx .bcx .ins() - .iconst(clif_ty, u64::try_from(const_val).expect("uint") as i64) + .iconst(clif_ty, const_val.to_bits(layout.size).unwrap() as i64) } ty::Float(FloatTy::F32) => { fx.bcx.ins().f32const(Ieee32::with_bits(u32::try_from(const_val).unwrap())) |
