@@ -120,14 +120,12 @@ fn main() {
120
120
} ;
121
121
cmd. args ( & args) . env ( dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
122
122
123
- if let Some ( crate_name) = crate_name {
124
- if let Some ( target) = env:: var_os ( "RUSTC_TIME" ) {
125
- if target == "all"
126
- || target. into_string ( ) . unwrap ( ) . split ( ',' ) . any ( |c| c. trim ( ) == crate_name)
127
- {
128
- cmd. arg ( "-Ztime-passes" ) ;
129
- }
130
- }
123
+ if let Some ( crate_name) = crate_name
124
+ && let Some ( target) = env:: var_os ( "RUSTC_TIME" )
125
+ && ( target == "all"
126
+ || target. into_string ( ) . unwrap ( ) . split ( ',' ) . any ( |c| c. trim ( ) == crate_name) )
127
+ {
128
+ cmd. arg ( "-Ztime-passes" ) ;
131
129
}
132
130
133
131
// Print backtrace in case of ICE
@@ -242,10 +240,10 @@ fn main() {
242
240
}
243
241
}
244
242
245
- if env:: var_os ( "RUSTC_BOLT_LINK_FLAGS" ) . is_some ( ) {
246
- if let Some ( "rustc_driver" ) = crate_name {
247
- cmd . arg ( "-Clink-args=-Wl,-q" ) ;
248
- }
243
+ if env:: var_os ( "RUSTC_BOLT_LINK_FLAGS" ) . is_some ( )
244
+ && let Some ( "rustc_driver" ) = crate_name
245
+ {
246
+ cmd . arg ( "-Clink-args=-Wl,-q" ) ;
249
247
}
250
248
251
249
let is_test = args. iter ( ) . any ( |a| a == "--test" ) ;
@@ -282,25 +280,24 @@ fn main() {
282
280
( child, status)
283
281
} ;
284
282
285
- if env:: var_os ( "RUSTC_PRINT_STEP_TIMINGS" ) . is_some ( )
286
- || env:: var_os ( "RUSTC_PRINT_STEP_RUSAGE" ) . is_some ( )
283
+ if ( env:: var_os ( "RUSTC_PRINT_STEP_TIMINGS" ) . is_some ( )
284
+ || env:: var_os ( "RUSTC_PRINT_STEP_RUSAGE" ) . is_some ( ) )
285
+ && let Some ( crate_name) = crate_name
287
286
{
288
- if let Some ( crate_name) = crate_name {
289
- let dur = start. elapsed ( ) ;
290
- // If the user requested resource usage data, then
291
- // include that in addition to the timing output.
292
- let rusage_data =
293
- env:: var_os ( "RUSTC_PRINT_STEP_RUSAGE" ) . and_then ( |_| format_rusage_data ( child) ) ;
294
- eprintln ! (
295
- "[RUSTC-TIMING] {} test:{} {}.{:03}{}{}" ,
296
- crate_name,
297
- is_test,
298
- dur. as_secs( ) ,
299
- dur. subsec_millis( ) ,
300
- if rusage_data. is_some( ) { " " } else { "" } ,
301
- rusage_data. unwrap_or_default( ) ,
302
- ) ;
303
- }
287
+ let dur = start. elapsed ( ) ;
288
+ // If the user requested resource usage data, then
289
+ // include that in addition to the timing output.
290
+ let rusage_data =
291
+ env:: var_os ( "RUSTC_PRINT_STEP_RUSAGE" ) . and_then ( |_| format_rusage_data ( child) ) ;
292
+ eprintln ! (
293
+ "[RUSTC-TIMING] {} test:{} {}.{:03}{}{}" ,
294
+ crate_name,
295
+ is_test,
296
+ dur. as_secs( ) ,
297
+ dur. subsec_millis( ) ,
298
+ if rusage_data. is_some( ) { " " } else { "" } ,
299
+ rusage_data. unwrap_or_default( ) ,
300
+ ) ;
304
301
}
305
302
306
303
if status. success ( ) {
0 commit comments