about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-10-15 14:21:54 +0800
committerGitHub <noreply@github.com>2017-10-15 14:21:54 +0800
commit34a286bf9075f944f5d581e66f7d362d104a4959 (patch)
tree95ab1edbbeaaac390dacfa5e77f254e092d07fff
parente598ac9872b0a17dcdcf1e5b6259e0aa6762fd4c (diff)
parent45502d23fb7849bc4afc2dc6a2ebf15b7ef13ff8 (diff)
downloadrust-34a286bf9075f944f5d581e66f7d362d104a4959.tar.gz
rust-34a286bf9075f944f5d581e66f7d362d104a4959.zip
Rollup merge of #45258 - hdhoang:master, r=alexcrichton
compiletest/runtest: format ErrorKind with Display

The strings are nouns for the most part, so we give ErrorKind::Help a
more sensible string. This reduces quote hiccups in failure output.

unexpected "error": '...'
↓
unexpected error: '...'
-rw-r--r--src/tools/compiletest/src/errors.rs2
-rw-r--r--src/tools/compiletest/src/runtest.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs
index b7fb3670165..251dd4d5edb 100644
--- a/src/tools/compiletest/src/errors.rs
+++ b/src/tools/compiletest/src/errors.rs
@@ -45,7 +45,7 @@ impl FromStr for ErrorKind {
 impl fmt::Display for ErrorKind {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
-            ErrorKind::Help => write!(f, "help"),
+            ErrorKind::Help => write!(f, "help message"),
             ErrorKind::Error => write!(f, "error"),
             ErrorKind::Note => write!(f, "note"),
             ErrorKind::Suggestion => write!(f, "suggestion"),
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index af9061ab367..60acc20e692 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1041,7 +1041,7 @@ actual:\n\
                 None => {
                     if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
                         self.error(
-                            &format!("{}:{}: unexpected {:?}: '{}'",
+                            &format!("{}:{}: unexpected {}: '{}'",
                                      file_name,
                                      actual_error.line_num,
                                      actual_error.kind.as_ref()