diff options
| author | Eric Huss <eric@huss.org> | 2020-09-14 14:42:37 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2020-09-14 14:42:37 -0700 |
| commit | 32efcfca2fece73a69efcedd1c78f45b0bbcb39c (patch) | |
| tree | fa587c240ba21b729ee7f7ae552f62f17f6ac95a | |
| parent | 57c5f40cf4d7685538f6e3a405612f939e0a5e47 (diff) | |
| download | rust-32efcfca2fece73a69efcedd1c78f45b0bbcb39c.tar.gz rust-32efcfca2fece73a69efcedd1c78f45b0bbcb39c.zip | |
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.
| -rw-r--r-- | src/tools/lint-docs/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs index 5323bc357c0..92b3d186fa1 100644 --- a/src/tools/lint-docs/src/lib.rs +++ b/src/tools/lint-docs/src/lib.rs @@ -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()) |
