@@ -105,15 +105,7 @@ impl Step for Std {
105105 cargo. arg ( "--lib" ) ;
106106 }
107107
108- let msg = if compiler. host == target {
109- format ! ( "Checking stage{} library artifacts ({target})" , builder. top_stage)
110- } else {
111- format ! (
112- "Checking stage{} library artifacts ({} -> {})" ,
113- builder. top_stage, & compiler. host, target
114- )
115- } ;
116- builder. info ( & msg) ;
108+ let _guard = builder. msg_check ( "library artifacts" , target) ;
117109 run_cargo (
118110 builder,
119111 cargo,
@@ -167,18 +159,7 @@ impl Step for Std {
167159 cargo. arg ( "-p" ) . arg ( krate. name ) ;
168160 }
169161
170- let msg = if compiler. host == target {
171- format ! (
172- "Checking stage{} library test/bench/example targets ({target})" ,
173- builder. top_stage
174- )
175- } else {
176- format ! (
177- "Checking stage{} library test/bench/example targets ({} -> {})" ,
178- builder. top_stage, & compiler. host, target
179- )
180- } ;
181- builder. info ( & msg) ;
162+ let _guard = builder. msg_check ( "library test/bench/example targets" , target) ;
182163 run_cargo (
183164 builder,
184165 cargo,
@@ -252,15 +233,7 @@ impl Step for Rustc {
252233 cargo. arg ( "-p" ) . arg ( krate. name ) ;
253234 }
254235
255- let msg = if compiler. host == target {
256- format ! ( "Checking stage{} compiler artifacts ({target})" , builder. top_stage)
257- } else {
258- format ! (
259- "Checking stage{} compiler artifacts ({} -> {})" ,
260- builder. top_stage, & compiler. host, target
261- )
262- } ;
263- builder. info ( & msg) ;
236+ let _guard = builder. msg_check ( "compiler artifacts" , target) ;
264237 run_cargo (
265238 builder,
266239 cargo,
@@ -317,15 +290,7 @@ impl Step for CodegenBackend {
317290 . arg ( builder. src . join ( format ! ( "compiler/rustc_codegen_{}/Cargo.toml" , backend) ) ) ;
318291 rustc_cargo_env ( builder, & mut cargo, target, compiler. stage ) ;
319292
320- let msg = if compiler. host == target {
321- format ! ( "Checking stage{} {} artifacts ({target})" , builder. top_stage, backend)
322- } else {
323- format ! (
324- "Checking stage{} {} library ({} -> {})" ,
325- builder. top_stage, backend, & compiler. host. triple, target. triple
326- )
327- } ;
328- builder. info ( & msg) ;
293+ let _guard = builder. msg_check ( & backend, target) ;
329294
330295 run_cargo (
331296 builder,
@@ -385,15 +350,7 @@ impl Step for RustAnalyzer {
385350 cargo. arg ( "--benches" ) ;
386351 }
387352
388- let msg = if compiler. host == target {
389- format ! ( "Checking stage{} {} artifacts ({target})" , compiler. stage, "rust-analyzer" )
390- } else {
391- format ! (
392- "Checking stage{} {} artifacts ({} -> {})" ,
393- compiler. stage, "rust-analyzer" , & compiler. host. triple, target. triple
394- )
395- } ;
396- builder. info ( & msg) ;
353+ let _guard = builder. msg_check ( "rust-analyzer artifacts" , target) ;
397354 run_cargo (
398355 builder,
399356 cargo,
@@ -460,18 +417,7 @@ macro_rules! tool_check_step {
460417 // NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
461418 // See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
462419 cargo. rustflag( "-Zunstable-options" ) ;
463- let msg = if compiler. host == target {
464- format!( "Checking stage{} {} artifacts ({target})" , builder. top_stage, stringify!( $name) . to_lowercase( ) )
465- } else {
466- format!(
467- "Checking stage{} {} artifacts ({} -> {})" ,
468- builder. top_stage,
469- stringify!( $name) . to_lowercase( ) ,
470- & compiler. host. triple,
471- target. triple
472- )
473- } ;
474- builder. info( & msg) ;
420+ let _guard = builder. msg_check( & concat!( stringify!( $name) , " artifacts" ) . to_lowercase( ) , target) ;
475421 run_cargo(
476422 builder,
477423 cargo,
0 commit comments