Upgrade to rustfmt 0.8.3.

This commit is contained in:
Jakob Stoklund Olesen
2017-04-27 12:52:41 -07:00
parent 962a3a6a5e
commit 15606fa735
8 changed files with 43 additions and 22 deletions

View File

@@ -40,11 +40,13 @@ impl SubTest for TestLegalizer {
let isa = context.isa.expect("legalizer needs an ISA");
comp_ctx.flowgraph();
comp_ctx.legalize(isa)
comp_ctx
.legalize(isa)
.map_err(|e| pretty_error(&comp_ctx.func, e))?;
let mut text = String::new();
write_function(&mut text, &comp_ctx.func, Some(isa)).map_err(|e| e.to_string())?;
write_function(&mut text, &comp_ctx.func, Some(isa))
.map_err(|e| e.to_string())?;
run_filecheck(&text, context)
}
}

View File

@@ -45,13 +45,16 @@ impl SubTest for TestRegalloc {
comp_ctx.flowgraph();
// TODO: Should we have an option to skip legalization?
comp_ctx.legalize(isa)
comp_ctx
.legalize(isa)
.map_err(|e| pretty_error(&comp_ctx.func, e))?;
comp_ctx.regalloc(isa)
comp_ctx
.regalloc(isa)
.map_err(|e| pretty_error(&comp_ctx.func, e))?;
let mut text = String::new();
write_function(&mut text, &comp_ctx.func, Some(isa)).map_err(|e| e.to_string())?;
write_function(&mut text, &comp_ctx.func, Some(isa))
.map_err(|e| e.to_string())?;
run_filecheck(&text, context)
}
}

View File

@@ -26,7 +26,8 @@ pub fn run(path: &Path) -> TestResult {
}
// Parse the test commands.
let mut tests = testfile.commands
let mut tests = testfile
.commands
.iter()
.map(new_subtest)
.collect::<Result<Vec<_>>>()?;
@@ -116,7 +117,8 @@ fn run_one_test<'a>(tuple: (&'a SubTest, &'a Flags, Option<&'a TargetIsa>),
// Should we run the verifier before this test?
if !context.verified && test.needs_verifier() {
verify_function(&func, isa).map_err(|e| pretty_verifier_error(&func, e))?;
verify_function(&func, isa)
.map_err(|e| pretty_verifier_error(&func, e))?;
context.verified = true;
}

View File

@@ -76,12 +76,14 @@ impl<'a> filecheck::VariableMap for Context<'a> {
/// Run filecheck on `text`, using directives extracted from `context`.
pub fn run_filecheck(text: &str, context: &Context) -> Result<()> {
let checker = build_filechecker(context)?;
if checker.check(&text, context)
if checker
.check(&text, context)
.map_err(|e| format!("filecheck: {}", e))? {
Ok(())
} else {
// Filecheck mismatch. Emit an explanation as output.
let (_, explain) = checker.explain(&text, context)
let (_, explain) = checker
.explain(&text, context)
.map_err(|e| format!("explain: {}", e))?;
Err(format!("filecheck failed:\n{}{}", checker, explain))
}
@@ -92,11 +94,13 @@ pub fn build_filechecker(context: &Context) -> Result<Checker> {
let mut builder = CheckerBuilder::new();
// Preamble comments apply to all functions.
for comment in context.preamble_comments {
builder.directive(comment.text)
builder
.directive(comment.text)
.map_err(|e| format!("filecheck: {}", e))?;
}
for comment in &context.details.comments {
builder.directive(comment.text)
builder
.directive(comment.text)
.map_err(|e| format!("filecheck: {}", e))?;
}
let checker = builder.finish();