Ensure a non-zero value is returned by clippy if compilation fails

This commit is contained in:
Fraser Hutchison 2018-06-21 05:20:14 +01:00
parent cd90441a73
commit 5be00bcd18

View file

@ -13,7 +13,7 @@ extern crate rustc_plugin;
extern crate syntax; extern crate syntax;
use rustc_driver::{driver::CompileController, Compilation}; use rustc_driver::{driver::CompileController, Compilation};
use std::process::Command; use std::process::{exit, Command};
#[allow(print_stdout)] #[allow(print_stdout)]
fn show_version() { fn show_version() {
@ -133,5 +133,10 @@ pub fn main() {
} }
controller.compilation_done.stop = Compilation::Stop; controller.compilation_done.stop = Compilation::Stop;
rustc_driver::run_compiler(&args, Box::new(controller), None, None); if rustc_driver::run_compiler(&args, Box::new(controller), None, None)
.0
.is_err()
{
exit(101);
}
} }