diff options
| author | Cadu <cadu.coelho@gmail.com> | 2022-04-04 19:14:33 -0300 |
|---|---|---|
| committer | Cadu <cadu.coelho@gmail.com> | 2022-04-04 19:15:20 -0300 |
| commit | ca9718aa4285bc3cd697c44516af0dd8f98a1cf9 (patch) | |
| tree | c42ba18f06b23a6b649ac6c8406ad043797e8e71 | |
| parent | 8e5c57f050aad35e2c5653597a40c3e0ac762465 (diff) | |
| download | rust-ca9718aa4285bc3cd697c44516af0dd8f98a1cf9.tar.gz rust-ca9718aa4285bc3cd697c44516af0dd8f98a1cf9.zip | |
Made error output the contents of Cargo's stderr as well.
| -rw-r--r-- | crates/flycheck/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 1168f11f968..b01f275cdc9 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -2,7 +2,7 @@ //! another compatible command (f.x. clippy) in a background thread and provide //! LSP diagnostics based on the output of the command. -use std::{fmt, io, process::Command, time::Duration}; +use std::{fmt, io, process::Command, time::Duration, str::from_utf8}; use crossbeam_channel::{never, select, unbounded, Receiver, Sender}; use paths::AbsPathBuf; @@ -329,8 +329,8 @@ impl CargoActor { Ok(output) if output.status.success() => Ok(()), Ok(output) => { Err(io::Error::new(io::ErrorKind::Other, format!( - "Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nMake sure you have `cargo clippy` installed and updated.", - output.status + "Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nCargo's stderr output:\n{}", + output.status, from_utf8(&output.stderr).unwrap_or("(Error: Could not fetch Cargo's stderr output)") ))) } Err(e) => Err(io::Error::new(e.kind(), format!("{:?}: {}", e, error))), |
