Fix clippy warnings.

This commit fixes the current set of (stable) clippy warnings in the repo.
This commit is contained in:
Peter Huene
2019-10-23 23:15:42 -07:00
committed by Andrew Brown
parent 1176e4f178
commit 9f506692c2
93 changed files with 667 additions and 662 deletions

View File

@@ -645,13 +645,14 @@ impl<'c, 'f> ir::InstInserterBase<'c> for &'c mut FuncCursor<'f> {
let prev_op = self.data_flow_graph()[prev].opcode();
let inst_op = self.data_flow_graph()[inst].opcode();
let curr_op = self.data_flow_graph()[curr].opcode();
if prev_op.is_branch() && !prev_op.is_terminator() {
if !inst_op.is_terminator() {
panic!(
"Inserting instruction {} after {}, and before {}",
inst_op, prev_op, curr_op
)
};
if prev_op.is_branch()
&& !prev_op.is_terminator()
&& !inst_op.is_terminator()
{
panic!(
"Inserting instruction {} after {}, and before {}",
inst_op, prev_op, curr_op
)
}
};
};
@@ -773,15 +774,16 @@ impl<'c, 'f> ir::InstInserterBase<'c> for &'c mut EncCursor<'f> {
if let Some(prev) = self.layout().prev_inst(curr) {
let prev_op = self.data_flow_graph()[prev].opcode();
let inst_op = self.data_flow_graph()[inst].opcode();
if prev_op.is_branch() && !prev_op.is_terminator() {
if !inst_op.is_terminator() {
panic!(
"Inserting instruction {} after {} and before {}",
self.display_inst(inst),
self.display_inst(prev),
self.display_inst(curr)
)
};
if prev_op.is_branch()
&& !prev_op.is_terminator()
&& !inst_op.is_terminator()
{
panic!(
"Inserting instruction {} after {} and before {}",
self.display_inst(inst),
self.display_inst(prev),
self.display_inst(curr)
)
}
};
};