Skip to content

Commit

Permalink
Include non-JSON output in error display for lint-doc failure.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ehuss committed Sep 14, 2020
1 parent 57c5f40 commit 32efcfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tools/lint-docs/src/lib.rs
Expand Up @@ -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())
Expand Down

0 comments on commit 32efcfc

Please sign in to comment.