From 5be00bcd1835145ff71ec3539c2bf849da0e37ed Mon Sep 17 00:00:00 2001 From: Fraser Hutchison Date: Thu, 21 Jun 2018 05:20:14 +0100 Subject: [PATCH] Ensure a non-zero value is returned by clippy if compilation fails --- src/driver.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/driver.rs b/src/driver.rs index 830c89856..419f61f86 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -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); + } }