Avoid unnecessary '&' in matches.
https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
This commit is contained in:
@@ -10,8 +10,8 @@ use ir::{self, InstBuilder};
|
||||
/// Expand a `global_addr` instruction according to the definition of the global variable.
|
||||
pub fn expand_global_addr(inst: ir::Inst, func: &mut ir::Function, _cfg: &mut ControlFlowGraph) {
|
||||
// Unpack the instruction.
|
||||
let gv = match &func.dfg[inst] {
|
||||
&ir::InstructionData::UnaryGlobalVar { opcode, global_var } => {
|
||||
let gv = match func.dfg[inst] {
|
||||
ir::InstructionData::UnaryGlobalVar { opcode, global_var } => {
|
||||
assert_eq!(opcode, ir::Opcode::GlobalAddr);
|
||||
global_var
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ use ir::condcodes::IntCC;
|
||||
/// Expand a `heap_addr` instruction according to the definition of the heap.
|
||||
pub fn expand_heap_addr(inst: ir::Inst, func: &mut ir::Function, _cfg: &mut ControlFlowGraph) {
|
||||
// Unpack the instruction.
|
||||
let (heap, offset, size) = match &func.dfg[inst] {
|
||||
&ir::InstructionData::HeapAddr {
|
||||
let (heap, offset, size) = match func.dfg[inst] {
|
||||
ir::InstructionData::HeapAddr {
|
||||
opcode,
|
||||
heap,
|
||||
arg,
|
||||
|
||||
@@ -169,7 +169,7 @@ impl<'a> Verifier<'a> {
|
||||
seen.insert(gv);
|
||||
|
||||
let mut cur = gv;
|
||||
while let &ir::GlobalVarData::Deref { base, .. } = &self.func.global_vars[cur] {
|
||||
while let ir::GlobalVarData::Deref { base, .. } = self.func.global_vars[cur] {
|
||||
if seen.insert(base).is_some() {
|
||||
return err!(gv, "deref cycle: {}", DisplayList(seen.as_slice()));
|
||||
}
|
||||
|
||||
@@ -420,8 +420,8 @@ fn translate_operator(
|
||||
// and push a new control frame with a new ebb for the code after the if/then/else
|
||||
// At the end of the then clause we jump to the destination
|
||||
let i = control_stack.len() - 1;
|
||||
let (destination, return_values, branch_inst) = match &control_stack[i] {
|
||||
&ControlStackFrame::If {
|
||||
let (destination, return_values, branch_inst) = match control_stack[i] {
|
||||
ControlStackFrame::If {
|
||||
destination,
|
||||
ref return_values,
|
||||
branch_inst,
|
||||
@@ -1276,9 +1276,9 @@ fn translate_unreachable_operator(
|
||||
} else {
|
||||
// Encountering an real else means that the code in the else
|
||||
// clause is reachable again
|
||||
let (branch_inst, original_stack_size) =
|
||||
match &control_stack[control_stack.len() - 1] {
|
||||
&ControlStackFrame::If {
|
||||
let (branch_inst, original_stack_size) = match control_stack[control_stack.len() -
|
||||
1] {
|
||||
ControlStackFrame::If {
|
||||
branch_inst,
|
||||
original_stack_size,
|
||||
..
|
||||
|
||||
Reference in New Issue
Block a user