Skip to content

Commit a06e3d9

Browse files
authored
Rollup merge of rust-lang#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: '...'
2 parents 8095717 + 45502d2 commit a06e3d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/tools/compiletest/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl FromStr for ErrorKind {
4545
impl fmt::Display for ErrorKind {
4646
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4747
match *self {
48-
ErrorKind::Help => write!(f, "help"),
48+
ErrorKind::Help => write!(f, "help message"),
4949
ErrorKind::Error => write!(f, "error"),
5050
ErrorKind::Note => write!(f, "note"),
5151
ErrorKind::Suggestion => write!(f, "suggestion"),

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ actual:\n\
10411041
None => {
10421042
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
10431043
self.error(
1044-
&format!("{}:{}: unexpected {:?}: '{}'",
1044+
&format!("{}:{}: unexpected {}: '{}'",
10451045
file_name,
10461046
actual_error.line_num,
10471047
actual_error.kind.as_ref()

0 commit comments

Comments
 (0)