diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 408eda5ba5b..59ddc16715d 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) ); } }