Skip to content

Commit 2a000c8

Browse files
committed
Don't panic on unknown JSON-like output lines
This function is called for both compiler and non-compiler output, so if the line isn't recognized as JSON from the compiler then just print it as-is.
1 parent e9e27ab commit 2a000c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/tools/compiletest/src/json.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ pub fn extract_rendered(output: &str) -> String {
127127
// Ignore the notification.
128128
None
129129
} else {
130-
print!(
131-
"failed to decode compiler output as json: line: {}\noutput: {}",
132-
line, output
133-
);
134-
panic!()
130+
// This function is called for both compiler and non-compiler output,
131+
// so if the line isn't recognized as JSON from the compiler then
132+
// just print it as-is.
133+
Some(format!("{line}\n"))
135134
}
136135
} else {
137136
// preserve non-JSON lines, such as ICEs

0 commit comments

Comments
 (0)