u64::try_from
will now fail if ScalarInt
isn't exactly 64 bits, thus we use to_bits
with the correct size
This commit is contained in:
parent
97bfff1f56
commit
6e6c8a86e9
@ -261,7 +261,7 @@ impl<'tcx> CValue<'tcx> {
|
|||||||
fx
|
fx
|
||||||
.bcx
|
.bcx
|
||||||
.ins()
|
.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) => {
|
ty::Float(FloatTy::F32) => {
|
||||||
fx.bcx.ins().f32const(Ieee32::with_bits(u32::try_from(const_val).unwrap()))
|
fx.bcx.ins().f32const(Ieee32::with_bits(u32::try_from(const_val).unwrap()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user