Skip to content

Commit dbc9e36

Browse files
authored
Merge pull request #2863 from Fraser999/exit_code
Ensure a non-zero value is returned by clippy if compilation fails
2 parents a66bab1 + 5be00bc commit dbc9e36

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/driver.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern crate rustc_plugin;
1313
extern crate syntax;
1414

1515
use rustc_driver::{driver::CompileController, Compilation};
16-
use std::process::Command;
16+
use std::process::{exit, Command};
1717

1818
#[allow(print_stdout)]
1919
fn show_version() {
@@ -133,5 +133,10 @@ pub fn main() {
133133
}
134134
controller.compilation_done.stop = Compilation::Stop;
135135

136-
rustc_driver::run_compiler(&args, Box::new(controller), None, None);
136+
if rustc_driver::run_compiler(&args, Box::new(controller), None, None)
137+
.0
138+
.is_err()
139+
{
140+
exit(101);
141+
}
137142
}

0 commit comments

Comments
 (0)