@@ -130,6 +130,13 @@ fn entry_fn(tcx: TyCtxt<'_>) -> (DefId, MiriEntryFnType) {
130130 }
131131}
132132
133+ /// If for whatever reason the supervisor process exists but can't see that
134+ /// we died, inform it manually.
135+ fn exit ( return_code : i32 ) -> ! {
136+ miri:: kill_sv ( return_code) ;
137+ std:: process:: exit ( return_code)
138+ }
139+
133140impl rustc_driver:: Callbacks for MiriCompilerCalls {
134141 fn config ( & mut self , config : & mut Config ) {
135142 config. override_queries = Some ( |_, providers| {
@@ -213,7 +220,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
213220 if !many_seeds. keep_going {
214221 // `abort_if_errors` would actually not stop, since `par_for_each` waits for the
215222 // rest of the to finish, so we just exit immediately.
216- std :: process :: exit ( return_code) ;
223+ exit ( return_code) ;
217224 }
218225 exit_code. store ( return_code, Ordering :: Relaxed ) ;
219226 num_failed. fetch_add ( 1 , Ordering :: Relaxed ) ;
@@ -223,15 +230,15 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
223230 if num_failed > 0 {
224231 eprintln ! ( "{num_failed}/{total} SEEDS FAILED" , total = many_seeds. seeds. count( ) ) ;
225232 }
226- std :: process :: exit ( exit_code. 0 . into_inner ( ) ) ;
233+ exit ( exit_code. 0 . into_inner ( ) ) ;
227234 } else {
228235 let return_code = miri:: eval_entry ( tcx, entry_def_id, entry_type, & config, None )
229236 . unwrap_or_else ( || {
230237 tcx. dcx ( ) . abort_if_errors ( ) ;
231238 rustc_driver:: EXIT_FAILURE
232239 } ) ;
233240
234- std :: process :: exit ( return_code) ;
241+ exit ( return_code) ;
235242 }
236243
237244 // Unreachable.
@@ -326,7 +333,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
326333
327334fn show_error ( msg : & impl std:: fmt:: Display ) -> ! {
328335 eprintln ! ( "fatal error: {msg}" ) ;
329- std :: process :: exit ( 1 )
336+ exit ( 1 )
330337}
331338
332339macro_rules! show_error {
@@ -400,7 +407,7 @@ fn run_compiler_and_exit(
400407 // Invoke compiler, and handle return code.
401408 let exit_code =
402409 rustc_driver:: catch_with_exit_code ( move || rustc_driver:: run_compiler ( args, callbacks) ) ;
403- std :: process :: exit ( exit_code)
410+ exit ( exit_code)
404411}
405412
406413/// Parses a comma separated list of `T` from the given string:
@@ -479,7 +486,7 @@ fn main() {
479486 let env_snapshot = env:: vars_os ( ) . collect :: < Vec < _ > > ( ) ;
480487
481488 let args = rustc_driver:: catch_fatal_errors ( || rustc_driver:: args:: raw_args ( & early_dcx) )
482- . unwrap_or_else ( |_| std :: process :: exit ( rustc_driver:: EXIT_FAILURE ) ) ;
489+ . unwrap_or_else ( |_| exit ( rustc_driver:: EXIT_FAILURE ) ) ;
483490
484491 // Install the ctrlc handler that sets `rustc_const_eval::CTRL_C_RECEIVED`, even if
485492 // MIRI_BE_RUSTC is set.
0 commit comments