Skip to content

Commit 6ac7c33

Browse files
Wilfredyue4u
authored andcommitted
Allow the check command to terminate without output
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 rust-lang#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.
1 parent 7aff546 commit 6ac7c33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/flycheck/src/lib.rs

Lines changed: 2 additions & 2 deletions
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)