Auto merge of #1413 - RalfJung:catch_with_exit_code, r=RalfJung

use new rustc_driver::catch_with_exit_code
This commit is contained in:
bors 2020-05-16 09:30:49 +00:00
commit 70b66aa007
2 changed files with 3 additions and 8 deletions

View File

@ -1 +1 @@
6f5c7827b71d1e1e4831fa7522e49acaf2a9e44e
84539360498cab3c70a7c9114c0b8106c8e1b06b

View File

@ -144,14 +144,9 @@ fn run_compiler(mut args: Vec<String>, callbacks: &mut (dyn rustc_driver::Callba
args.splice(1..1, miri::miri_default_args().iter().map(ToString::to_string));
// Invoke compiler, and handle return code.
let result = rustc_driver::catch_fatal_errors(move || {
let exit_code = rustc_driver::catch_with_exit_code(move || {
rustc_driver::run_compiler(&args, callbacks, None, None)
})
.and_then(|result| result);
let exit_code = match result {
Ok(()) => rustc_driver::EXIT_SUCCESS,
Err(_) => rustc_driver::EXIT_FAILURE,
};
});
std::process::exit(exit_code)
}