Skip to content

Commit

Permalink
Auto merge of #52256 - tinco:issue_52255, r=sanxiyn
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
bors committed Jul 12, 2018
2 parents 7db82cc + b96deed commit 6cc42a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/test/pretty/cast-lt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -21,4 +21,3 @@
macro_rules! negative(( $ e : expr ) => { $ e < 0 });

fn main() { (1 as i32) < 0; }

1 change: 0 additions & 1 deletion src/test/pretty/cast-lt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ macro_rules! negative {
fn main() {
negative!(1 as i32);
}

2 changes: 1 addition & 1 deletion src/test/pretty/issue-4264.pp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 3 additions & 4 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand All @@ -531,7 +530,7 @@ impl<'test> TestCx<'test> {
{}\n\
------------------------------------------\n\
\n",
expected, actual
expected, actual)
);
}
}
Expand Down

0 comments on commit 6cc42a4

Please sign in to comment.