Merge pull request #2863 from Fraser999/exit_code

Ensure a non-zero value is returned by clippy if compilation fails
This commit is contained in:
Oliver Schneider 2018-06-21 10:26:32 +02:00 committed by GitHub
commit dbc9e3674f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ extern crate rustc_plugin;
extern crate syntax;
use rustc_driver::{driver::CompileController, Compilation};
use std::process::Command;
use std::process::{exit, Command};
#[allow(print_stdout)]
fn show_version() {
@ -133,5 +133,10 @@ pub fn main() {
}
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);
}
}