@@ -48,19 +48,6 @@ const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[
4848 // build for, so there is no entry for "aarch64-apple-darwin" here.
4949] ;
5050
51- fn try_run ( builder : & Builder < ' _ > , cmd : & mut Command ) -> bool {
52- if !builder. fail_fast {
53- if builder. try_run ( cmd) . is_err ( ) {
54- let mut failures = builder. delayed_failures . borrow_mut ( ) ;
55- failures. push ( format ! ( "{:?}" , cmd) ) ;
56- return false ;
57- }
58- } else {
59- builder. run ( cmd) ;
60- }
61- true
62- }
63-
6451fn try_run_quiet ( builder : & Builder < ' _ > , cmd : & mut Command ) -> bool {
6552 if !builder. fail_fast {
6653 if !builder. try_run_quiet ( cmd) {
@@ -193,7 +180,9 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
193180 let _guard =
194181 builder. msg ( Kind :: Test , compiler. stage , "Linkcheck" , bootstrap_host, bootstrap_host) ;
195182 let _time = util:: timeit ( & builder) ;
196- try_run ( builder, linkchecker. arg ( builder. out . join ( host. triple ) . join ( "doc" ) ) ) ;
183+ builder. try_run (
184+ linkchecker. arg ( builder. out . join ( host. triple ) . join ( "doc" ) ) ,
185+ ) ;
197186 }
198187
199188 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -246,7 +235,7 @@ impl Step for HtmlCheck {
246235 builder. default_doc ( & [ ] ) ;
247236 builder. ensure ( crate :: doc:: Rustc :: new ( builder. top_stage , self . target , builder) ) ;
248237
249- try_run ( builder , builder. tool_cmd ( Tool :: HtmlChecker ) . arg ( builder. doc_out ( self . target ) ) ) ;
238+ builder . try_run ( builder. tool_cmd ( Tool :: HtmlChecker ) . arg ( builder. doc_out ( self . target ) ) ) ;
250239 }
251240}
252241
@@ -285,8 +274,7 @@ impl Step for Cargotest {
285274
286275 let _time = util:: timeit ( & builder) ;
287276 let mut cmd = builder. tool_cmd ( Tool :: CargoTest ) ;
288- try_run (
289- builder,
277+ builder. try_run (
290278 cmd. arg ( & cargo)
291279 . arg ( & out_dir)
292280 . args ( builder. config . test_args ( ) )
@@ -827,7 +815,8 @@ impl Step for Clippy {
827815
828816 let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
829817
830- if builder. try_run ( & mut cargo) . is_ok ( ) {
818+ #[ allow( deprecated) ] // Clippy reports errors if it blessed the outputs
819+ if builder. config . try_run ( & mut cargo) . is_ok ( ) {
831820 // The tests succeeded; nothing to do.
832821 return ;
833822 }
@@ -887,7 +876,7 @@ impl Step for RustdocTheme {
887876 util:: lld_flag_no_threads ( self . compiler . host . contains ( "windows" ) ) ,
888877 ) ;
889878 }
890- try_run ( builder , & mut cmd) ;
879+ builder . try_run ( & mut cmd) ;
891880 }
892881}
893882
@@ -1147,7 +1136,7 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
11471136 }
11481137
11491138 builder. info ( "tidy check" ) ;
1150- try_run ( builder , & mut cmd) ;
1139+ builder . try_run ( & mut cmd) ;
11511140
11521141 builder. ensure ( ExpandYamlAnchors ) ;
11531142
@@ -1192,8 +1181,7 @@ impl Step for ExpandYamlAnchors {
11921181 /// by the user before committing CI changes.
11931182 fn run ( self , builder : & Builder < ' _ > ) {
11941183 builder. info ( "Ensuring the YAML anchors in the GitHub Actions config were expanded" ) ;
1195- try_run (
1196- builder,
1184+ builder. try_run (
11971185 & mut builder. tool_cmd ( Tool :: ExpandYamlAnchors ) . arg ( "check" ) . arg ( & builder. src ) ,
11981186 ) ;
11991187 }
@@ -1982,7 +1970,7 @@ impl BookTest {
19821970 compiler. host ,
19831971 ) ;
19841972 let _time = util:: timeit ( & builder) ;
1985- let toolstate = if try_run ( builder , & mut rustbook_cmd) {
1973+ let toolstate = if builder . try_run ( & mut rustbook_cmd) {
19861974 ToolState :: TestPass
19871975 } else {
19881976 ToolState :: TestFail
@@ -2144,7 +2132,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
21442132 cmd. arg ( "--test-args" ) . arg ( test_args) ;
21452133
21462134 if builder. config . verbose_tests {
2147- try_run ( builder , & mut cmd)
2135+ builder . try_run ( & mut cmd)
21482136 } else {
21492137 try_run_quiet ( builder, & mut cmd)
21502138 }
@@ -2172,7 +2160,7 @@ impl Step for RustcGuide {
21722160
21732161 let src = builder. src . join ( relative_path) ;
21742162 let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) ;
2175- let toolstate = if try_run ( builder , rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ) {
2163+ let toolstate = if builder . try_run ( rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ) {
21762164 ToolState :: TestPass
21772165 } else {
21782166 ToolState :: TestFail
@@ -2725,7 +2713,7 @@ impl Step for Bootstrap {
27252713 . current_dir ( builder. src . join ( "src/bootstrap/" ) ) ;
27262714 // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible.
27272715 // Use `python -m unittest` manually if you want to pass arguments.
2728- try_run ( builder , & mut check_bootstrap) ;
2716+ builder . try_run ( & mut check_bootstrap) ;
27292717
27302718 let mut cmd = Command :: new ( & builder. initial_cargo ) ;
27312719 cmd. arg ( "test" )
@@ -2801,7 +2789,7 @@ impl Step for TierCheck {
28012789 self . compiler . host ,
28022790 self . compiler . host ,
28032791 ) ;
2804- try_run ( builder , & mut cargo. into ( ) ) ;
2792+ builder . try_run ( & mut cargo. into ( ) ) ;
28052793 }
28062794}
28072795
@@ -2887,7 +2875,7 @@ impl Step for RustInstaller {
28872875 cmd. env ( "CARGO" , & builder. initial_cargo ) ;
28882876 cmd. env ( "RUSTC" , & builder. initial_rustc ) ;
28892877 cmd. env ( "TMP_DIR" , & tmpdir) ;
2890- try_run ( builder , & mut cmd) ;
2878+ builder . try_run ( & mut cmd) ;
28912879 }
28922880
28932881 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
0 commit comments