11891: Better error message on Flycheck Error message (from: unactionable error message if we are using `clippy` as the checker) r=Veykril a=flipbit03

I have commented on this [S-unactionable issue](https://github.com/rust-analyzer/rust-analyzer/issues/6589) that the Flycheck error message should maybe provide a hint about what tool it actually runs. Searching on some places on the Internet I've found multiple people, including myself, losing copious amounts of time on the same issue. So I've decided to make this very small PR :-)

From an user experience standpoint, the current error message is unhelpful to the end user, because the end user does not know exactly what it needs to check/fix (outdated, broken, or missing `cargo clippy`). In my own case, `cargo clippy` was actually missing altogether (developing off `rust:1.59.0-bullseye` official Docker image).

Thanks in advance!




Co-authored-by: Cadu <cadu.coelho@gmail.com>
This commit is contained in:
bors[bot] 2022-04-05 16:31:18 +00:00 committed by GitHub
commit ee6becc5dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: {:?})",
output.status
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nCargo's stderr output:\n{}",
output.status, error
)))
}
Err(e) => Err(io::Error::new(e.kind(), format!("{:?}: {}", e, error))),