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