mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-30 09:24:35 +00:00
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: '...'
This commit is contained in:
commit
34a286bf90
@ -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"),
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user