Skip to content

Commit ca9718a

Browse files
committed
Made error output the contents of Cargo's stderr as well.
1 parent 8e5c57f commit ca9718a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/flycheck/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! another compatible command (f.x. clippy) in a background thread and provide
33
//! LSP diagnostics based on the output of the command.
44
5-
use std::{fmt, io, process::Command, time::Duration};
5+
use std::{fmt, io, process::Command, time::Duration, str::from_utf8};
66

77
use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
88
use paths::AbsPathBuf;
@@ -329,8 +329,8 @@ impl CargoActor {
329329
Ok(output) if output.status.success() => Ok(()),
330330
Ok(output) => {
331331
Err(io::Error::new(io::ErrorKind::Other, format!(
332-
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nMake sure you have `cargo clippy` installed and updated.",
333-
output.status
332+
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nCargo's stderr output:\n{}",
333+
output.status, from_utf8(&output.stderr).unwrap_or("(Error: Could not fetch Cargo's stderr output)")
334334
)))
335335
}
336336
Err(e) => Err(io::Error::new(e.kind(), format!("{:?}: {}", e, error))),

0 commit comments

Comments
 (0)