]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/transform/const_prop.rs
Auto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix
[rust.git] / src / librustc_mir / transform / const_prop.rs
index 7c5b895fa757265536291247e1274125fdb7ccd8..05e51c5430d7fe5aafd0f4b9741974e09722dc70 100644 (file)
@@ -369,7 +369,7 @@ fn const_prop(
                     Value::Scalar(Scalar::Bits {
                         bits: n as u128,
                         size: self.tcx.data_layout.pointer_size.bytes() as u8,
-                    }),
+                    }.into()),
                     self.tcx.layout_of(self.param_env.and(self.tcx.types.usize)).ok()?,
                     span,
                 )))
@@ -391,7 +391,7 @@ fn const_prop(
                     this.ecx.value_to_scalar(ValTy { value: val.0, ty: val.1.ty })
                 })?;
                 let val = self.use_ecx(source_info, |this| this.ecx.unary_op(op, prim, val.1))?;
-                Some((Value::Scalar(val), place_layout, span))
+                Some((Value::Scalar(val.into()), place_layout, span))
             }
             Rvalue::CheckedBinaryOp(op, ref left, ref right) |
             Rvalue::BinaryOp(op, ref left, ref right) => {