Auto merge of #52256 - tinco:issue_52255, r=sanxiyn

make pretty source comparison check be fatal (fixes #52255)

This is not ready for merging because it reveals (at least) two regressions in the pretty suite. Should I attempt to fix those in this PR also?
This commit is contained in:
bors 2018-07-12 15:12:37 +00:00
commit 6cc42a4488
4 changed files with 5 additions and 8 deletions

View File

@ -3,7 +3,7 @@
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
extern crate std;
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
@ -21,4 +21,3 @@ extern crate std as std;
macro_rules! negative(( $ e : expr ) => { $ e < 0 });
fn main() { (1 as i32) < 0; }

View File

@ -19,4 +19,3 @@ macro_rules! negative {
fn main() {
negative!(1 as i32);
}

View File

@ -1,7 +1,7 @@
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
extern crate std;
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -519,9 +519,8 @@ impl<'test> TestCx<'test> {
fn compare_source(&self, expected: &str, actual: &str) {
if expected != actual {
self.error("pretty-printed source does not match expected source");
println!(
"\n\
self.fatal(&format!(
"pretty-printed source does not match expected source\n\
expected:\n\
------------------------------------------\n\
{}\n\
@ -531,7 +530,7 @@ impl<'test> TestCx<'test> {
{}\n\
------------------------------------------\n\
\n",
expected, actual
expected, actual)
);
}
}