We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
u64::try_from
ScalarInt
to_bits
1 parent 97bfff1 commit 6e6c8a8Copy full SHA for 6e6c8a8
compiler/rustc_codegen_cranelift/src/value_and_place.rs
@@ -261,7 +261,7 @@ impl<'tcx> CValue<'tcx> {
261
fx
262
.bcx
263
.ins()
264
- .iconst(clif_ty, u64::try_from(const_val).expect("uint") as i64)
+ .iconst(clif_ty, const_val.to_bits(layout.size).unwrap() as i64)
265
}
266
ty::Float(FloatTy::F32) => {
267
fx.bcx.ins().f32const(Ieee32::with_bits(u32::try_from(const_val).unwrap()))
0 commit comments