File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -671,7 +671,13 @@ fn run_test(
671671
672672 debug ! ( "compiler invocation for doctest: {compiler:?}" ) ;
673673
674- let mut child = compiler. spawn ( ) . expect ( "Failed to spawn rustc process" ) ;
674+ let mut child = match compiler. spawn ( ) {
675+ Ok ( child) => child,
676+ Err ( error) => {
677+ eprintln ! ( "Failed to run compiler: {error:?}" ) ;
678+ return ( Duration :: default ( ) , Err ( TestFailure :: CompileError ) ) ;
679+ }
680+ } ;
675681 let output = if let Some ( merged_test_code) = & doctest. merged_test_code {
676682 // compile-fail tests never get merged, so this should always pass
677683 let status = child. wait ( ) . expect ( "Failed to wait" ) ;
@@ -733,7 +739,13 @@ fn run_test(
733739 let status = if !status. success ( ) {
734740 status
735741 } else {
736- let mut child_runner = runner_compiler. spawn ( ) . expect ( "Failed to spawn rustc process" ) ;
742+ let mut child_runner = match runner_compiler. spawn ( ) {
743+ Ok ( child) => child,
744+ Err ( error) => {
745+ eprintln ! ( "Failed to spawn rustc process: {error:?}" ) ;
746+ return ( Duration :: default ( ) , Err ( TestFailure :: CompileError ) ) ;
747+ }
748+ } ;
737749 child_runner. wait ( ) . expect ( "Failed to wait" )
738750 } ;
739751
You can’t perform that action at this time.
0 commit comments