From adfdd773119492812a0d4f789d1281a039a5cd42 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 31 Aug 2017 11:38:55 -0700 Subject: [PATCH] Avoid creating a reference to a reference. https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_borrow --- lib/cretonne/src/regalloc/coalescing.rs | 2 +- lib/wasm/src/runtime/dummy.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cretonne/src/regalloc/coalescing.rs b/lib/cretonne/src/regalloc/coalescing.rs index 35957f90c1..509f5a45e7 100644 --- a/lib/cretonne/src/regalloc/coalescing.rs +++ b/lib/cretonne/src/regalloc/coalescing.rs @@ -468,7 +468,7 @@ impl<'a> Context<'a> { /// Leave `self.values` unchanged on failure. fn add_class(&mut self, value: Value) -> Result<(), (Value, Value)> { self.forest.try_merge( - &self.values, + self.values, self.virtregs.congruence_class(&value), &self.func.dfg, &self.func.layout, diff --git a/lib/wasm/src/runtime/dummy.rs b/lib/wasm/src/runtime/dummy.rs index 0d6a7755e9..7e8dc02005 100644 --- a/lib/wasm/src/runtime/dummy.rs +++ b/lib/wasm/src/runtime/dummy.rs @@ -26,7 +26,7 @@ impl WasmRuntime for DummyRuntime { builder: &mut FunctionBuilder, global_index: GlobalIndex, ) -> Value { - let ref glob = self.globals[global_index as usize]; + let glob = self.globals[global_index as usize]; match glob.ty { I32 => builder.ins().iconst(glob.ty, -1), I64 => builder.ins().iconst(glob.ty, -1),