@@ -213,6 +213,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
213
213
if !many_seeds. keep_going {
214
214
// `abort_if_errors` would actually not stop, since `par_for_each` waits for the
215
215
// rest of the to finish, so we just exit immediately.
216
+ miri:: register_retcode_sv ( return_code) ;
216
217
std:: process:: exit ( return_code) ;
217
218
}
218
219
exit_code. store ( return_code, Ordering :: Relaxed ) ;
@@ -223,7 +224,9 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
223
224
if num_failed > 0 {
224
225
eprintln ! ( "{num_failed}/{total} SEEDS FAILED" , total = many_seeds. seeds. count( ) ) ;
225
226
}
226
- std:: process:: exit ( exit_code. 0 . into_inner ( ) ) ;
227
+ let code = exit_code. 0 . into_inner ( ) ;
228
+ miri:: register_retcode_sv ( code) ;
229
+ std:: process:: exit ( code) ;
227
230
} else {
228
231
let return_code = miri:: eval_entry ( tcx, entry_def_id, entry_type, & config, None )
229
232
. unwrap_or_else ( || {
@@ -232,6 +235,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
232
235
tcx. dcx ( ) . abort_if_errors ( ) ;
233
236
rustc_driver:: EXIT_FAILURE
234
237
} ) ;
238
+ miri:: register_retcode_sv ( return_code) ;
235
239
std:: process:: exit ( return_code) ;
236
240
}
237
241
@@ -329,6 +333,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
329
333
330
334
fn show_error ( msg : & impl std:: fmt:: Display ) -> ! {
331
335
eprintln ! ( "fatal error: {msg}" ) ;
336
+ miri:: register_retcode_sv ( 1 ) ;
332
337
std:: process:: exit ( 1 )
333
338
}
334
339
@@ -403,6 +408,7 @@ fn run_compiler_and_exit(
403
408
// Invoke compiler, and handle return code.
404
409
let exit_code =
405
410
rustc_driver:: catch_with_exit_code ( move || rustc_driver:: run_compiler ( args, callbacks) ) ;
411
+ miri:: register_retcode_sv ( exit_code) ;
406
412
std:: process:: exit ( exit_code)
407
413
}
408
414
@@ -482,7 +488,10 @@ fn main() {
482
488
let env_snapshot = env:: vars_os ( ) . collect :: < Vec < _ > > ( ) ;
483
489
484
490
let args = rustc_driver:: catch_fatal_errors ( || rustc_driver:: args:: raw_args ( & early_dcx) )
485
- . unwrap_or_else ( |_| std:: process:: exit ( rustc_driver:: EXIT_FAILURE ) ) ;
491
+ . unwrap_or_else ( |_| {
492
+ miri:: register_retcode_sv ( rustc_driver:: EXIT_FAILURE ) ;
493
+ std:: process:: exit ( rustc_driver:: EXIT_FAILURE )
494
+ } ) ;
486
495
487
496
// Install the ctrlc handler that sets `rustc_const_eval::CTRL_C_RECEIVED`, even if
488
497
// MIRI_BE_RUSTC is set.
0 commit comments