]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/transform/simplify_comparison_integral.rs
Shrink the size of Rvalue by 16 bytes
[rust.git] / compiler / rustc_mir / src / transform / simplify_comparison_integral.rs
index bd76e118fdf71650d42d4915d5ad726245109c66..32df40ebf9e9e5465c90709952e6b846f7136dbe 100644 (file)
@@ -84,10 +84,10 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
 
                 use Operand::*;
                 match rhs {
-                    Rvalue::BinaryOp(_, ref mut left @ Move(_), Constant(_)) => {
+                    Rvalue::BinaryOp(_, box (ref mut left @ Move(_), Constant(_))) => {
                         *left = Copy(opt.to_switch_on);
                     }
-                    Rvalue::BinaryOp(_, Constant(_), ref mut right @ Move(_)) => {
+                    Rvalue::BinaryOp(_, box (Constant(_), ref mut right @ Move(_))) => {
                         *right = Copy(opt.to_switch_on);
                     }
                     _ => (),
@@ -166,7 +166,10 @@ fn find_optimizations(&self) -> Vec<OptimizationInfo<'tcx>> {
                             if *lhs == place_switched_on =>
                         {
                             match rhs {
-                                Rvalue::BinaryOp(op @ (BinOp::Eq | BinOp::Ne), left, right) => {
+                                Rvalue::BinaryOp(
+                                    op @ (BinOp::Eq | BinOp::Ne),
+                                    box (left, right),
+                                ) => {
                                     let (branch_value_scalar, branch_value_ty, to_switch_on) =
                                         find_branch_value_info(left, right)?;