mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-20 11:37:32 +00:00
Include non-JSON output in error display for lint-doc failure.
Some errors, like if rustc is broken, or dylib search path is wrong, will only display non-JSON errors. Show those, too, to make it easier to debug a problem.
This commit is contained in:
parent
57c5f40cf4
commit
32efcfca2f
@ -402,9 +402,12 @@ fn generate_lint_output(
|
|||||||
None => {
|
None => {
|
||||||
let rendered: Vec<&str> =
|
let rendered: Vec<&str> =
|
||||||
msgs.iter().filter_map(|msg| msg["rendered"].as_str()).collect();
|
msgs.iter().filter_map(|msg| msg["rendered"].as_str()).collect();
|
||||||
|
let non_json: Vec<&str> =
|
||||||
|
stderr.lines().filter(|line| !line.starts_with('{')).collect();
|
||||||
Err(format!(
|
Err(format!(
|
||||||
"did not find lint `{}` in output of example, got:\n{}",
|
"did not find lint `{}` in output of example, got:\n{}\n{}",
|
||||||
name,
|
name,
|
||||||
|
non_json.join("\n"),
|
||||||
rendered.join("\n")
|
rendered.join("\n")
|
||||||
)
|
)
|
||||||
.into())
|
.into())
|
||||||
|
Loading…
Reference in New Issue
Block a user