Skip to content

Commit

Permalink
Don't emit explain with json short messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Sep 24, 2019
1 parent 6ef275e commit 6d07874
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/libsyntax/json.rs
Expand Up @@ -112,6 +112,13 @@ impl Emitter for JsonEmitter {
panic!("failed to print notification: {:?}", e);
}
}

fn should_show_explain(&self) -> bool {
match self.json_rendered {
HumanReadableErrorType::Short(_) => false,
_ => true,
}
}
}

// The following data types are provided just for serialisation.
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/json-short.stderr
Expand Up @@ -15,5 +15,3 @@ started: https://doc.rust-lang.org/book/
"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error
"}
{"message":"For more information about this error, try `rustc --explain E0601`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0601`.
"}

0 comments on commit 6d07874

Please sign in to comment.