Skip to content

Commit d1e756e

Browse files
bors[bot]Wilfred
andauthored
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 <[email protected]>
2 parents e46f1fd + f6f6b3a commit d1e756e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/flycheck/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ impl CargoActor {
326326
);
327327
match output {
328328
Ok(_) if read_at_least_one_message => Ok(()),
329-
Ok(output) if output.status.success() => {
329+
Ok(output) if output.status.success() => Ok(()),
330+
Ok(output) => {
330331
Err(io::Error::new(io::ErrorKind::Other, format!(
331332
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})",
332333
output.status
333334
)))
334335
}
335-
Ok(_) => Err(io::Error::new(io::ErrorKind::Other, error)),
336336
Err(e) => Err(e),
337337
}
338338
}

0 commit comments

Comments
 (0)