Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/tools/compiletest/src/json.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! These structs are a subset of the ones found in `rustc_errors::json`.
//! They are only used for deserialization of JSON output provided by libtest.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: you are right, this is wrong; it's not libtest, it's not just compiler, it's also rustdoc and maybe even more.


use std::path::{Path, PathBuf};
use std::str::FromStr;
Expand Down Expand Up @@ -127,11 +126,10 @@ pub fn extract_rendered(output: &str) -> String {
// Ignore the notification.
None
} else {
print!(
"failed to decode compiler output as json: line: {}\noutput: {}",
line, output
);
panic!()
// 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.
Some(format!("{line}\n"))
}
} else {
// preserve non-JSON lines, such as ICEs
Expand Down