Update to the rustfmt in rust 1.28, which is now stable.

Also, rustfmt's --write-mode=check is now named --check.
This commit is contained in:
Dan Gohman
2018-08-02 09:05:47 -07:00
parent 26d122306d
commit cd75176f10
40 changed files with 186 additions and 125 deletions

View File

@@ -307,7 +307,8 @@ impl<'a> Context<'a> {
// Create a live range for the new value.
// TODO: Should we handle ghost values?
let affinity = Affinity::new(
&self.encinfo
&self
.encinfo
.operand_constraints(pos.func.encodings[inst])
.expect("Bad copy encoding")
.outs[0],
@@ -352,7 +353,8 @@ impl<'a> Context<'a> {
// Create a live range for the new value.
// TODO: Handle affinity for ghost values.
let affinity = Affinity::new(
&self.encinfo
&self
.encinfo
.operand_constraints(pos.func.encodings[inst])
.expect("Bad copy encoding")
.outs[0],
@@ -419,7 +421,8 @@ impl<'a> Context<'a> {
let node = Node::value(value, 0, self.func);
// Push this value and get the nearest dominating def back.
let parent = match self.forest
let parent = match self
.forest
.push_node(node, self.func, self.domtree, self.preorder)
{
None => continue,

View File

@@ -527,7 +527,8 @@ impl<'a> Context<'a> {
/// all values used by the instruction.
fn program_complete_input_constraints(&mut self) {
let inst = self.cur.current_inst().expect("Not on an instruction");
let constraints = self.encinfo
let constraints = self
.encinfo
.operand_constraints(self.cur.func.encodings[inst])
.expect("Current instruction not encoded")
.ins;
@@ -643,7 +644,8 @@ impl<'a> Context<'a> {
Pred: FnMut(&LiveRange, LiveRangeContext<Layout>) -> bool,
{
for rdiv in self.divert.all() {
let lr = self.liveness
let lr = self
.liveness
.get(rdiv.value)
.expect("Missing live range for diverted register");
if pred(lr, self.liveness.context(&self.cur.func.layout)) {
@@ -942,7 +944,8 @@ impl<'a> Context<'a> {
..
} => {
debug_assert_eq!(slot[to_slot].expand(), None, "Overwriting slot in use");
let ss = self.cur
let ss = self
.cur
.func
.stack_slots
.get_emergency_slot(self.cur.func.dfg.value_type(value), &slot[0..spills]);

View File

@@ -187,7 +187,8 @@ impl LiveValueTracker {
// If the immediate dominator exits, we must have a stored list for it. This is a
// requirement to the order EBBs are visited: All dominators must have been processed
// before the current EBB.
let idom_live_list = self.idom_sets
let idom_live_list = self
.idom_sets
.get(&idom)
.expect("No stored live set for dominator");
let ctx = liveness.context(layout);

View File

@@ -340,7 +340,8 @@ impl Liveness {
where
PP: Into<ProgramPoint>,
{
let old = self.ranges
let old = self
.ranges
.insert(LiveRange::new(value, def.into(), affinity));
debug_assert!(old.is_none(), "{} already has a live range", value);
}

View File

@@ -114,7 +114,8 @@ impl Pressure {
}
// Compute per-class limits from `usable`.
for (toprc, rc) in p.toprc
for (toprc, rc) in p
.toprc
.iter_mut()
.take_while(|t| t.num_toprcs > 0)
.zip(reginfo.classes)

View File

@@ -166,7 +166,8 @@ impl<'a> Context<'a> {
if arg.affinity.is_stack() {
// An incoming register parameter was spilled. Replace the parameter value
// with a temporary register value that is immediately spilled.
let reg = self.cur
let reg = self
.cur
.func
.dfg
.replace_ebb_param(arg.value, abi.value_type);
@@ -199,7 +200,8 @@ impl<'a> Context<'a> {
self.cur.use_srcloc(inst);
// Get the operand constraints for `inst` that we are trying to satisfy.
let constraints = self.encinfo
let constraints = self
.encinfo
.operand_constraints(encoding)
.expect("Missing instruction encoding");
@@ -276,7 +278,8 @@ impl<'a> Context<'a> {
// Same thing for spilled call return values.
let retvals = &defs[constraints.outs.len()..];
if !retvals.is_empty() {
let sig = self.cur
let sig = self
.cur
.func
.dfg
.call_signature(inst)

View File

@@ -125,7 +125,8 @@ impl<'a> Context<'a> {
self.process_spills(tracker);
while let Some(inst) = self.cur.next_inst() {
if let Some(constraints) = self.encinfo
if let Some(constraints) = self
.encinfo
.operand_constraints(self.cur.func.encodings[inst])
{
self.visit_inst(inst, ebb, constraints, tracker);
@@ -494,7 +495,8 @@ impl<'a> Context<'a> {
}
// Assign a spill slot for the whole virtual register.
let ss = self.cur
let ss = self
.cur
.func
.stack_slots
.make_spill_slot(self.cur.func.dfg.value_type(value));

View File

@@ -152,7 +152,8 @@ impl VirtRegs {
});
// Determine the insertion position for `single`.
let index = match self.values(vreg)
let index = match self
.values(vreg)
.binary_search_by(|&v| preorder.pre_cmp_def(v, single, func))
{
Ok(_) => panic!("{} already in {}", single, vreg),