Avoid matching with reference patterns.

This commit is contained in:
Dan Gohman
2017-11-08 10:40:56 -08:00
parent 809e2f0c91
commit 5d3ae0596c

View File

@@ -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,
)