Skip to content

Commit fc5c437

Browse files
author
Jonathan Turner
committed
Output the full output along with the line
1 parent d25688e commit fc5c437

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/compiletest/src/json.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ struct DiagnosticCode {
5757

5858
pub fn parse_output(file_name: &str, output: &str) -> Vec<Error> {
5959
output.lines()
60-
.flat_map(|line| parse_line(file_name, line))
60+
.flat_map(|line| parse_line(file_name, line, output))
6161
.collect()
6262
}
6363

64-
fn parse_line(file_name: &str, line: &str) -> Vec<Error> {
64+
fn parse_line(file_name: &str, line: &str, output: &str) -> Vec<Error> {
6565
// The compiler sometimes intermingles non-JSON stuff into the
6666
// output. This hack just skips over such lines. Yuck.
6767
if line.chars().next() == Some('{') {
@@ -72,8 +72,8 @@ fn parse_line(file_name: &str, line: &str) -> Vec<Error> {
7272
expected_errors
7373
}
7474
Err(error) => {
75-
panic!("failed to decode compiler output as json: `{}` when parsing: {}", error,
76-
line);
75+
panic!("failed to decode compiler output as json: `{}`\noutput: {}\nline: {}",
76+
error, line, output);
7777
}
7878
}
7979
} else {

0 commit comments

Comments
 (0)