@@ -65,19 +65,21 @@ impl fmt::Display for TestKind {
6565 }
6666}
6767
68- fn try_run_expecting ( build : & Build , cmd : & mut Command , expect : BuildExpectation ) {
68+ fn try_run_expecting ( build : & Build , cmd : & mut Command , expect : BuildExpectation ) -> bool {
6969 if !build. fail_fast {
7070 if !build. try_run ( cmd, expect) {
7171 let mut failures = build. delayed_failures . borrow_mut ( ) ;
7272 failures. push ( format ! ( "{:?}" , cmd) ) ;
73+ return false ;
7374 }
7475 } else {
7576 build. run_expecting ( cmd, expect) ;
7677 }
78+ true
7779}
7880
7981fn try_run ( build : & Build , cmd : & mut Command ) {
80- try_run_expecting ( build, cmd, BuildExpectation :: None )
82+ try_run_expecting ( build, cmd, BuildExpectation :: None ) ;
8183}
8284
8385fn try_run_quiet ( build : & Build , cmd : & mut Command ) {
@@ -257,11 +259,13 @@ impl Step for Rls {
257259
258260 builder. add_rustc_lib_path ( compiler, & mut cargo) ;
259261
260- try_run_expecting (
262+ if try_run_expecting (
261263 build,
262264 & mut cargo,
263265 builder. build . config . toolstate . rls . passes ( ToolState :: Testing ) ,
264- ) ;
266+ ) {
267+ build. save_toolstate ( "rls" , ToolState :: Testing ) ;
268+ }
265269 }
266270}
267271
@@ -305,11 +309,13 @@ impl Step for Rustfmt {
305309
306310 builder. add_rustc_lib_path ( compiler, & mut cargo) ;
307311
308- try_run_expecting (
312+ if try_run_expecting (
309313 build,
310314 & mut cargo,
311315 builder. build . config . toolstate . rustfmt . passes ( ToolState :: Testing ) ,
312- ) ;
316+ ) {
317+ build. save_toolstate ( "rustfmt" , ToolState :: Testing ) ;
318+ }
313319 }
314320}
315321
@@ -354,11 +360,13 @@ impl Step for Miri {
354360
355361 builder. add_rustc_lib_path ( compiler, & mut cargo) ;
356362
357- try_run_expecting (
363+ if try_run_expecting (
358364 build,
359365 & mut cargo,
360366 builder. build . config . toolstate . miri . passes ( ToolState :: Testing ) ,
361- ) ;
367+ ) {
368+ build. save_toolstate ( "miri" , ToolState :: Testing ) ;
369+ }
362370 } else {
363371 eprintln ! ( "failed to test miri: could not build" ) ;
364372 }
@@ -411,11 +419,13 @@ impl Step for Clippy {
411419
412420 builder. add_rustc_lib_path ( compiler, & mut cargo) ;
413421
414- try_run_expecting (
422+ if try_run_expecting (
415423 build,
416424 & mut cargo,
417425 builder. build . config . toolstate . clippy . passes ( ToolState :: Testing ) ,
418- ) ;
426+ ) {
427+ build. save_toolstate ( "clippy-driver" , ToolState :: Testing ) ;
428+ }
419429 } else {
420430 eprintln ! ( "failed to test clippy: could not build" ) ;
421431 }
0 commit comments