mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
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
5fa1c8f91a
commit
6e96e10f93
@ -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()))
|
||||
|
Loading…
Reference in New Issue
Block a user