Skip to content

Commit 32efcfc

Browse files
committed
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.
1 parent 57c5f40 commit 32efcfc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tools/lint-docs/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,12 @@ fn generate_lint_output(
402402
None => {
403403
let rendered: Vec<&str> =
404404
msgs.iter().filter_map(|msg| msg["rendered"].as_str()).collect();
405+
let non_json: Vec<&str> =
406+
stderr.lines().filter(|line| !line.starts_with('{')).collect();
405407
Err(format!(
406-
"did not find lint `{}` in output of example, got:\n{}",
408+
"did not find lint `{}` in output of example, got:\n{}\n{}",
407409
name,
410+
non_json.join("\n"),
408411
rendered.join("\n")
409412
)
410413
.into())

0 commit comments

Comments
 (0)