explanation: Option<String>,
}
-pub fn extract_rendered(output: &str, proc_res: &ProcRes) -> String {
+pub fn extract_rendered(output: &str) -> String {
output
.lines()
.filter_map(|line| {
match serde_json::from_str::<Diagnostic>(line) {
Ok(diagnostic) => diagnostic.rendered,
Err(error) => {
- proc_res.fatal(Some(&format!(
+ print!(
"failed to decode compiler output as json: \
`{}`\nline: {}\noutput: {}",
error, line, output
- )));
+ );
+ panic!()
}
}
} else {
let stderr = if explicit {
proc_res.stderr.clone()
} else {
- json::extract_rendered(&proc_res.stderr, &proc_res)
+ json::extract_rendered(&proc_res.stderr)
};
let normalized_stderr = self.normalize_output(&stderr, &self.props.normalize_stderr);
{}\n\
------------------------------------------\n\
\n",
- self.status, self.cmdline, self.stdout, self.stderr
+ self.status, self.cmdline,
+ json::extract_rendered(&self.stdout),
+ json::extract_rendered(&self.stderr),
);
panic!();
}