From cc7ba7e69a41cc7ff102f0ca4fc48c28feb01e40 Mon Sep 17 00:00:00 2001 From: Aaron Power Date: Wed, 25 Jul 2018 20:18:15 +0100 Subject: [PATCH] Fixed remaning clippy warnings --- lib/codegen/src/print_errors.rs | 10 +++++----- lib/codegen/src/regalloc/virtregs.rs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/codegen/src/print_errors.rs b/lib/codegen/src/print_errors.rs index 3cf6af6daa..5783056c03 100644 --- a/lib/codegen/src/print_errors.rs +++ b/lib/codegen/src/print_errors.rs @@ -39,22 +39,22 @@ fn pretty_function_error( match err.location { ir::entities::AnyEntity::Inst(inst) => { if inst == cur_inst { - write!( + writeln!( w, - "{1:0$}{2}\n", + "{1:0$}{2}", indent, "", func.dfg.display_inst(cur_inst, isa) )?; - write!(w, "{1:0$}{2}", indent, "", "^")?; + write!(w, "{1:0$}^", indent, "")?; for _c in cur_inst.to_string().chars() { write!(w, "~")?; } - write!(w, "\n\nverifier {}\n\n", err.to_string()) + writeln!(w, "\n\nverifier {}\n", err.to_string()) } else { write!( w, - "{1:0$}{2}\n", + "{1:0$}{2}", indent, "", func.dfg.display_inst(cur_inst, isa) diff --git a/lib/codegen/src/regalloc/virtregs.rs b/lib/codegen/src/regalloc/virtregs.rs index dbd4dceae7..ab2b749f7c 100644 --- a/lib/codegen/src/regalloc/virtregs.rs +++ b/lib/codegen/src/regalloc/virtregs.rs @@ -97,6 +97,7 @@ impl VirtRegs { /// /// If `value` belongs to a virtual register, the congruence class is the values of the virtual /// register. Otherwise it is just the value itself. + #[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] pub fn congruence_class<'a, 'b>(&'a self, value: &'b Value) -> &'b [Value] where 'a: 'b,