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
1 changed files with 4 additions and 1 deletions
|
@ -402,9 +402,12 @@ fn generate_lint_output(
|
|||
None => {
|
||||
let rendered: Vec<&str> =
|
||||
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!(
|
||||
"did not find lint `{}` in output of example, got:\n{}",
|
||||
"did not find lint `{}` in output of example, got:\n{}\n{}",
|
||||
name,
|
||||
non_json.join("\n"),
|
||||
rendered.join("\n")
|
||||
)
|
||||
.into())
|
||||
|
|
Loading…
Add table
Reference in a new issue