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() {
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue