@@ -130,6 +130,13 @@ fn entry_fn(tcx: TyCtxt<'_>) -> (DefId, MiriEntryFnType) {
130
130
}
131
131
}
132
132
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
+
133
140
impl rustc_driver:: Callbacks for MiriCompilerCalls {
134
141
fn config ( & mut self , config : & mut Config ) {
135
142
config. override_queries = Some ( |_, providers| {
@@ -213,7 +220,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
213
220
if !many_seeds. keep_going {
214
221
// `abort_if_errors` would actually not stop, since `par_for_each` waits for the
215
222
// rest of the to finish, so we just exit immediately.
216
- std :: process :: exit ( return_code) ;
223
+ exit ( return_code) ;
217
224
}
218
225
exit_code. store ( return_code, Ordering :: Relaxed ) ;
219
226
num_failed. fetch_add ( 1 , Ordering :: Relaxed ) ;
@@ -223,15 +230,15 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
223
230
if num_failed > 0 {
224
231
eprintln ! ( "{num_failed}/{total} SEEDS FAILED" , total = many_seeds. seeds. count( ) ) ;
225
232
}
226
- std :: process :: exit ( exit_code. 0 . into_inner ( ) ) ;
233
+ exit ( exit_code. 0 . into_inner ( ) ) ;
227
234
} else {
228
235
let return_code = miri:: eval_entry ( tcx, entry_def_id, entry_type, & config, None )
229
236
. unwrap_or_else ( || {
230
237
tcx. dcx ( ) . abort_if_errors ( ) ;
231
238
rustc_driver:: EXIT_FAILURE
232
239
} ) ;
233
240
234
- std :: process :: exit ( return_code) ;
241
+ exit ( return_code) ;
235
242
}
236
243
237
244
// Unreachable.
@@ -326,7 +333,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
326
333
327
334
fn show_error ( msg : & impl std:: fmt:: Display ) -> ! {
328
335
eprintln ! ( "fatal error: {msg}" ) ;
329
- std :: process :: exit ( 1 )
336
+ exit ( 1 )
330
337
}
331
338
332
339
macro_rules! show_error {
@@ -400,7 +407,7 @@ fn run_compiler_and_exit(
400
407
// Invoke compiler, and handle return code.
401
408
let exit_code =
402
409
rustc_driver:: catch_with_exit_code ( move || rustc_driver:: run_compiler ( args, callbacks) ) ;
403
- std :: process :: exit ( exit_code)
410
+ exit ( exit_code)
404
411
}
405
412
406
413
/// Parses a comma separated list of `T` from the given string:
@@ -479,7 +486,7 @@ fn main() {
479
486
let env_snapshot = env:: vars_os ( ) . collect :: < Vec < _ > > ( ) ;
480
487
481
488
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 ) ) ;
483
490
484
491
// Install the ctrlc handler that sets `rustc_const_eval::CTRL_C_RECEIVED`, even if
485
492
// MIRI_BE_RUSTC is set.
0 commit comments