Update rustfmt to 0.8.4; (#81)

This commit is contained in:
Benjamin Bouvier
2017-05-16 00:10:47 +02:00
committed by Jakob Stoklund Olesen
parent 232fb36d8f
commit 29dc723e25
20 changed files with 120 additions and 176 deletions

View File

@@ -132,8 +132,7 @@ impl<'c, 'fc, 'fd, Array> InstBuilderBase<'fd> for InsertReuseBuilder<'c, 'fc, '
let inst = self.dfg.make_inst(data);
// Make an `Interator<Item = Option<Value>>`.
let ru = self.reuse.as_ref().iter().cloned();
self.dfg
.make_inst_results_reusing(inst, ctrl_typevar, ru);
self.dfg.make_inst_results_reusing(inst, ctrl_typevar, ru);
self.pos.insert_inst(inst);
(inst, self.dfg)
}

View File

@@ -316,37 +316,25 @@ impl DataFlowGraph {
/// Get the fixed value arguments on `inst` as a slice.
pub fn inst_fixed_args(&self, inst: Inst) -> &[Value] {
let fixed_args = self[inst]
.opcode()
.constraints()
.fixed_value_arguments();
let fixed_args = self[inst].opcode().constraints().fixed_value_arguments();
&self.inst_args(inst)[..fixed_args]
}
/// Get the fixed value arguments on `inst` as a mutable slice.
pub fn inst_fixed_args_mut(&mut self, inst: Inst) -> &mut [Value] {
let fixed_args = self[inst]
.opcode()
.constraints()
.fixed_value_arguments();
let fixed_args = self[inst].opcode().constraints().fixed_value_arguments();
&mut self.inst_args_mut(inst)[..fixed_args]
}
/// Get the variable value arguments on `inst` as a slice.
pub fn inst_variable_args(&self, inst: Inst) -> &[Value] {
let fixed_args = self[inst]
.opcode()
.constraints()
.fixed_value_arguments();
let fixed_args = self[inst].opcode().constraints().fixed_value_arguments();
&self.inst_args(inst)[fixed_args..]
}
/// Get the variable value arguments on `inst` as a mutable slice.
pub fn inst_variable_args_mut(&mut self, inst: Inst) -> &mut [Value] {
let fixed_args = self[inst]
.opcode()
.constraints()
.fixed_value_arguments();
let fixed_args = self[inst].opcode().constraints().fixed_value_arguments();
&mut self.inst_args_mut(inst)[fixed_args..]
}

View File

@@ -288,20 +288,20 @@ impl InstructionData {
pub fn analyze_branch<'a>(&'a self, pool: &'a ValueListPool) -> BranchInfo<'a> {
match self {
&InstructionData::Jump {
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)),
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)),
&InstructionData::Branch {
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)[1..]),
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)[1..]),
&InstructionData::BranchIcmp {
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)[2..]),
destination,
ref args,
..
} => BranchInfo::SingleDest(destination, &args.as_slice(pool)[2..]),
&InstructionData::BranchTable { table, .. } => BranchInfo::Table(table),
_ => BranchInfo::NotABranch,
}
@@ -595,11 +595,7 @@ impl OperandConstraint {
Same => Bound(ctrl_type),
LaneOf => Bound(ctrl_type.lane_type()),
AsBool => Bound(ctrl_type.as_bool()),
HalfWidth => {
Bound(ctrl_type
.half_width()
.expect("invalid type for half_width"))
}
HalfWidth => Bound(ctrl_type.half_width().expect("invalid type for half_width")),
DoubleWidth => {
Bound(ctrl_type
.double_width()

View File

@@ -467,8 +467,7 @@ impl Layout {
/// Remove `inst` from the layout.
pub fn remove_inst(&mut self, inst: Inst) {
let ebb = self.inst_ebb(inst)
.expect("Instruction already removed.");
let ebb = self.inst_ebb(inst).expect("Instruction already removed.");
// Clear the `inst` node and extract links.
let prev;
let next;