mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
Merge #10756
10756: Allow the check command to terminate without output r=Veykril a=Wilfred Cargo will always output something on success: ``` $ cargo check --message-format=json {"reason":"compiler-artifact", ... snipped ... } {"reason":"build-finished","success":true} ``` However, rustc does not output anything on success: ``` $ rustc --error-format=json main.rs $ echo $? 0 ``` Restore the behaviour prior to #10517, where an exit code of 0 is considered good even if nothing is written to stdout. This enables custom overrideCommand values that use rustc rather than cargo. Co-authored-by: Wilfred Hughes <me@wilfred.me.uk>
This commit is contained in:
commit
d1e756e05a
1 changed files with 2 additions and 2 deletions
|
@ -326,13 +326,13 @@ impl CargoActor {
|
||||||
);
|
);
|
||||||
match output {
|
match output {
|
||||||
Ok(_) if read_at_least_one_message => Ok(()),
|
Ok(_) if read_at_least_one_message => Ok(()),
|
||||||
Ok(output) if output.status.success() => {
|
Ok(output) if output.status.success() => Ok(()),
|
||||||
|
Ok(output) => {
|
||||||
Err(io::Error::new(io::ErrorKind::Other, format!(
|
Err(io::Error::new(io::ErrorKind::Other, format!(
|
||||||
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})",
|
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})",
|
||||||
output.status
|
output.status
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
Ok(_) => Err(io::Error::new(io::ErrorKind::Other, error)),
|
|
||||||
Err(e) => Err(e),
|
Err(e) => Err(e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue