Merge pull request #3087 from rust-lang-nursery/run

Use the compilers exit code computation instead of rolling our own
This commit is contained in:
Oliver Schneider 2018-08-26 16:29:11 +02:00 committed by GitHub
commit 628934424e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,11 +13,12 @@ fn show_version() {
}
pub fn main() {
exit(rustc_driver::run(move || {
use std::env;
if std::env::args().any(|a| a == "--version" || a == "-V") {
show_version();
return;
exit(0);
}
let sys_root = option_env!("SYSROOT")
@ -128,10 +129,7 @@ pub fn main() {
}
controller.compilation_done.stop = Compilation::Stop;
if rustc_driver::run_compiler(&args, Box::new(controller), None, None)
.0
.is_err()
{
exit(101);
}
let args = args;
rustc_driver::run_compiler(&args, Box::new(controller), None, None)
}) as i32)
}