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:
commit
628934424e
1 changed files with 110 additions and 112 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue