Auto merge of #1413 - RalfJung:catch_with_exit_code, r=RalfJung
use new rustc_driver::catch_with_exit_code
This commit is contained in:
commit
70b66aa007
@ -1 +1 @@
|
||||
6f5c7827b71d1e1e4831fa7522e49acaf2a9e44e
|
||||
84539360498cab3c70a7c9114c0b8106c8e1b06b
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user