@@ -105,15 +105,7 @@ impl Step for Std {
105
105
cargo. arg ( "--lib" ) ;
106
106
}
107
107
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) ;
117
109
run_cargo (
118
110
builder,
119
111
cargo,
@@ -167,18 +159,7 @@ impl Step for Std {
167
159
cargo. arg ( "-p" ) . arg ( krate. name ) ;
168
160
}
169
161
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) ;
182
163
run_cargo (
183
164
builder,
184
165
cargo,
@@ -252,15 +233,7 @@ impl Step for Rustc {
252
233
cargo. arg ( "-p" ) . arg ( krate. name ) ;
253
234
}
254
235
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) ;
264
237
run_cargo (
265
238
builder,
266
239
cargo,
@@ -317,15 +290,7 @@ impl Step for CodegenBackend {
317
290
. arg ( builder. src . join ( format ! ( "compiler/rustc_codegen_{}/Cargo.toml" , backend) ) ) ;
318
291
rustc_cargo_env ( builder, & mut cargo, target, compiler. stage ) ;
319
292
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) ;
329
294
330
295
run_cargo (
331
296
builder,
@@ -385,15 +350,7 @@ impl Step for RustAnalyzer {
385
350
cargo. arg ( "--benches" ) ;
386
351
}
387
352
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) ;
397
354
run_cargo (
398
355
builder,
399
356
cargo,
@@ -460,18 +417,7 @@ macro_rules! tool_check_step {
460
417
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
461
418
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
462
419
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) ;
475
421
run_cargo(
476
422
builder,
477
423
cargo,
0 commit comments