@@ -196,7 +196,6 @@ pub struct Build {
196196 crates : HashMap < String , Crate > ,
197197 crate_paths : HashMap < PathBuf , String > ,
198198 is_sudo : bool ,
199- delayed_failures : RefCell < Vec < String > > ,
200199 prerelease_version : Cell < Option < u32 > > ,
201200
202201 #[ cfg( feature = "build-metrics" ) ]
@@ -457,7 +456,6 @@ impl Build {
457456 crates : HashMap :: new ( ) ,
458457 crate_paths : HashMap :: new ( ) ,
459458 is_sudo,
460- delayed_failures : RefCell :: new ( Vec :: new ( ) ) ,
461459 prerelease_version : Cell :: new ( None ) ,
462460
463461 #[ cfg( feature = "build-metrics" ) ]
@@ -672,8 +670,7 @@ impl Build {
672670 #[ cfg( feature = "tracing" ) ]
673671 let _sanity_check_span =
674672 span ! ( tracing:: Level :: DEBUG , "(1) executing dry-run sanity-check" ) . entered ( ) ;
675- self . config . dry_run = DryRun :: SelfCheck ;
676- self . config . exec_ctx . set_dry_run ( DryRun :: SelfCheck ) ;
673+ self . config . set_dry_run ( DryRun :: SelfCheck ) ;
677674 let builder = builder:: Builder :: new ( self ) ;
678675 builder. execute_cli ( ) ;
679676 }
@@ -683,8 +680,7 @@ impl Build {
683680 #[ cfg( feature = "tracing" ) ]
684681 let _actual_run_span =
685682 span ! ( tracing:: Level :: DEBUG , "(2) executing actual run" ) . entered ( ) ;
686- self . config . dry_run = DryRun :: Disabled ;
687- self . config . exec_ctx . set_dry_run ( DryRun :: Disabled ) ;
683+ self . config . set_dry_run ( DryRun :: Disabled ) ;
688684 let builder = builder:: Builder :: new ( self ) ;
689685 builder. execute_cli ( ) ;
690686 }
@@ -700,14 +696,7 @@ impl Build {
700696 debug ! ( "checking for postponed test failures from `test --no-fail-fast`" ) ;
701697
702698 // Check for postponed failures from `test --no-fail-fast`.
703- let failures = self . delayed_failures . borrow ( ) ;
704- if !failures. is_empty ( ) {
705- eprintln ! ( "\n {} command(s) did not execute successfully:\n " , failures. len( ) ) ;
706- for failure in failures. iter ( ) {
707- eprintln ! ( " - {failure}\n " ) ;
708- }
709- exit ! ( 1 ) ;
710- }
699+ self . config . exec_ctx ( ) . report_failures_and_exit ( ) ;
711700
712701 #[ cfg( feature = "build-metrics" ) ]
713702 self . metrics . persist ( self ) ;
@@ -956,7 +945,7 @@ impl Build {
956945 }
957946
958947 fn info ( & self , msg : & str ) {
959- match self . config . dry_run {
948+ match self . config . get_dry_run ( ) {
960949 DryRun :: SelfCheck => ( ) ,
961950 DryRun :: Disabled | DryRun :: UserSelected => {
962951 println ! ( "{msg}" ) ;
@@ -1079,7 +1068,7 @@ impl Build {
10791068
10801069 #[ track_caller]
10811070 fn group ( & self , msg : & str ) -> Option < gha:: Group > {
1082- match self . config . dry_run {
1071+ match self . config . get_dry_run ( ) {
10831072 DryRun :: SelfCheck => None ,
10841073 DryRun :: Disabled | DryRun :: UserSelected => Some ( gha:: group ( msg) ) ,
10851074 }
0 commit comments