From f0b1a781acebee0f3783377603cead74c9c7c2f5 Mon Sep 17 00:00:00 2001 From: Tinco Andringa Date: Wed, 11 Jul 2018 15:21:14 +0200 Subject: [PATCH 1/2] make pretty source comparison check be fatal (fixes #52255) --- src/tools/compiletest/src/runtest.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 408eda5ba5bb5..59ddc16715d3b 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -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) ); } } From b96deed121bae7f753ddcf11d419abd3962d39b5 Mon Sep 17 00:00:00 2001 From: Tinco Andringa Date: Thu, 12 Jul 2018 01:16:27 +0200 Subject: [PATCH 2/2] fix expected output of pretty/cast-lt and issue-4264 tests --- src/test/pretty/cast-lt.pp | 3 +-- src/test/pretty/cast-lt.rs | 1 - src/test/pretty/issue-4264.pp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/pretty/cast-lt.pp b/src/test/pretty/cast-lt.pp index b21158abfe551..f1b4b4f5a0c8a 100644 --- a/src/test/pretty/cast-lt.pp +++ b/src/test/pretty/cast-lt.pp @@ -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 @@ macro_rules! negative(( $ e : expr ) => { $ e < 0 }); fn main() { (1 as i32) < 0; } - diff --git a/src/test/pretty/cast-lt.rs b/src/test/pretty/cast-lt.rs index 87b5274545f38..ca4c364c63157 100644 --- a/src/test/pretty/cast-lt.rs +++ b/src/test/pretty/cast-lt.rs @@ -19,4 +19,3 @@ macro_rules! negative { fn main() { negative!(1 as i32); } - diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp index 81518b0b87271..a4380d9212fdf 100644 --- a/src/test/pretty/issue-4264.pp +++ b/src/test/pretty/issue-4264.pp @@ -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.