From 5d3ae0596c5265616157659935b40c78b8ff337b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 8 Nov 2017 10:40:56 -0800 Subject: [PATCH] Avoid matching with reference patterns. --- lib/cretonne/src/regalloc/solver.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cretonne/src/regalloc/solver.rs b/lib/cretonne/src/regalloc/solver.rs index a18599a127..c13ec65292 100644 --- a/lib/cretonne/src/regalloc/solver.rs +++ b/lib/cretonne/src/regalloc/solver.rs @@ -317,10 +317,10 @@ impl Move { /// Replace the "to" register with `new` and return the old value. fn replace_to_reg(&mut self, new: RegUnit) -> RegUnit { mem::replace( - match self { - &mut Move::Reg { ref mut to, .. } | - &mut Move::Fill { ref mut to, .. } => to, - &mut Move::Spill { .. } => panic!("No to register in a spill {}", self), + match *self { + Move::Reg { ref mut to, .. } | + Move::Fill { ref mut to, .. } => to, + Move::Spill { .. } => panic!("No to register in a spill {}", self), }, new, )