@@ -196,7 +196,6 @@ pub struct Build {
196
196
crates : HashMap < String , Crate > ,
197
197
crate_paths : HashMap < PathBuf , String > ,
198
198
is_sudo : bool ,
199
- delayed_failures : RefCell < Vec < String > > ,
200
199
prerelease_version : Cell < Option < u32 > > ,
201
200
202
201
#[ cfg( feature = "build-metrics" ) ]
@@ -457,7 +456,6 @@ impl Build {
457
456
crates : HashMap :: new ( ) ,
458
457
crate_paths : HashMap :: new ( ) ,
459
458
is_sudo,
460
- delayed_failures : RefCell :: new ( Vec :: new ( ) ) ,
461
459
prerelease_version : Cell :: new ( None ) ,
462
460
463
461
#[ cfg( feature = "build-metrics" ) ]
@@ -672,8 +670,7 @@ impl Build {
672
670
#[ cfg( feature = "tracing" ) ]
673
671
let _sanity_check_span =
674
672
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 ) ;
677
674
let builder = builder:: Builder :: new ( self ) ;
678
675
builder. execute_cli ( ) ;
679
676
}
@@ -683,8 +680,7 @@ impl Build {
683
680
#[ cfg( feature = "tracing" ) ]
684
681
let _actual_run_span =
685
682
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 ) ;
688
684
let builder = builder:: Builder :: new ( self ) ;
689
685
builder. execute_cli ( ) ;
690
686
}
@@ -700,14 +696,7 @@ impl Build {
700
696
debug ! ( "checking for postponed test failures from `test --no-fail-fast`" ) ;
701
697
702
698
// 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 ( ) ;
711
700
712
701
#[ cfg( feature = "build-metrics" ) ]
713
702
self . metrics . persist ( self ) ;
@@ -956,7 +945,7 @@ impl Build {
956
945
}
957
946
958
947
fn info ( & self , msg : & str ) {
959
- match self . config . dry_run {
948
+ match self . config . get_dry_run ( ) {
960
949
DryRun :: SelfCheck => ( ) ,
961
950
DryRun :: Disabled | DryRun :: UserSelected => {
962
951
println ! ( "{msg}" ) ;
@@ -1079,7 +1068,7 @@ impl Build {
1079
1068
1080
1069
#[ track_caller]
1081
1070
fn group ( & self , msg : & str ) -> Option < gha:: Group > {
1082
- match self . config . dry_run {
1071
+ match self . config . get_dry_run ( ) {
1083
1072
DryRun :: SelfCheck => None ,
1084
1073
DryRun :: Disabled | DryRun :: UserSelected => Some ( gha:: group ( msg) ) ,
1085
1074
}
0 commit comments