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

@@ -282,7 +282,8 @@ impl TestRunner {
/// Print out a report of slow tests.
fn report_slow_tests(&self) {
// Collect runtimes of succeeded tests.
let mut times = self.tests
let mut times = self
.tests
.iter()
.filter_map(|entry| match *entry {
QueueEntry {

View File

@@ -116,7 +116,8 @@ impl SubTest for TestBinEmit {
let mut func = func.into_owned();
// Fix the stack frame layout so we can test spill/fill encodings.
let min_offset = func.stack_slots
let min_offset = func
.stack_slots
.values()
.map(|slot| slot.offset.unwrap())
.min();
@@ -133,14 +134,12 @@ impl SubTest for TestBinEmit {
// Find an encoding that satisfies both immediate field and register
// constraints.
if let Some(enc) = {
let mut legal_encodings = isa.legal_encodings(
&func,
&func.dfg[inst],
func.dfg.ctrl_typevar(inst),
).filter(|e| {
let recipe_constraints = &encinfo.constraints[e.recipe()];
recipe_constraints.satisfied(inst, &divert, &func)
});
let mut legal_encodings = isa
.legal_encodings(&func, &func.dfg[inst], func.dfg.ctrl_typevar(inst))
.filter(|e| {
let recipe_constraints = &encinfo.constraints[e.recipe()];
recipe_constraints.satisfied(inst, &divert, &func)
});
if opt_level == OptLevel::Best {
// Get the smallest legal encoding
@@ -207,7 +206,8 @@ impl SubTest for TestBinEmit {
// Send legal encodings into the emitter.
if enc.is_legal() {
// Generate a better error message if output locations are not specified.
if let Some(&v) = func.dfg
if let Some(&v) = func
.dfg
.inst_results(inst)
.iter()
.find(|&&v| !func.locations[v].is_assigned())
@@ -236,7 +236,8 @@ impl SubTest for TestBinEmit {
if !enc.is_legal() {
// A possible cause of an unencoded instruction is a missing location for
// one of the input operands.
if let Some(&v) = func.dfg
if let Some(&v) = func
.dfg
.inst_args(inst)
.iter()
.find(|&&v| !func.locations[v].is_assigned())
@@ -249,11 +250,9 @@ impl SubTest for TestBinEmit {
}
// Do any encodings exist?
let encodings = isa.legal_encodings(
&func,
&func.dfg[inst],
func.dfg.ctrl_typevar(inst),
).map(|e| encinfo.display(e))
let encodings = isa
.legal_encodings(&func, &func.dfg[inst], func.dfg.ctrl_typevar(inst))
.map(|e| encinfo.display(e))
.collect::<Vec<_>>();
if encodings.is_empty() {

View File

@@ -93,7 +93,8 @@ impl SubTest for TestDomtree {
// Now we know that everything in `expected` is consistent with `domtree`.
// All other EBB's should be either unreachable or the entry block.
for ebb in func.layout
for ebb in func
.layout
.ebbs()
.skip(1)
.filter(|ebb| !expected.contains_key(ebb))