Skip to content

Commit 6cc42a4

Browse files
committed
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?
2 parents 7db82cc + b96deed commit 6cc42a4

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/test/pretty/cast-lt.pp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[prelude_import]
44
use std::prelude::v1::*;
55
#[macro_use]
6-
extern crate std as std;
6+
extern crate std;
77
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
88
// file at the top-level directory of this distribution and at
99
// http://rust-lang.org/COPYRIGHT.
@@ -21,4 +21,3 @@
2121
macro_rules! negative(( $ e : expr ) => { $ e < 0 });
2222

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

src/test/pretty/cast-lt.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ macro_rules! negative {
1919
fn main() {
2020
negative!(1 as i32);
2121
}
22-

src/test/pretty/issue-4264.pp

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

src/tools/compiletest/src/runtest.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,8 @@ impl<'test> TestCx<'test> {
519519

520520
fn compare_source(&self, expected: &str, actual: &str) {
521521
if expected != actual {
522-
self.error("pretty-printed source does not match expected source");
523-
println!(
524-
"\n\
522+
self.fatal(&format!(
523+
"pretty-printed source does not match expected source\n\
525524
expected:\n\
526525
------------------------------------------\n\
527526
{}\n\
@@ -531,7 +530,7 @@ impl<'test> TestCx<'test> {
531530
{}\n\
532531
------------------------------------------\n\
533532
\n",
534-
expected, actual
533+
expected, actual)
535534
);
536535
}
537536
}

0 commit comments

Comments
 (0)