This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -195,11 +195,17 @@ pub fn parse_config(args: Vec<String>) -> Config {
195195
196196 let src_base = opt_path ( matches, "src-base" ) ;
197197 let run_ignored = matches. opt_present ( "ignored" ) ;
198- let has_tidy = Command :: new ( "tidy" )
199- . arg ( "--version" )
200- . stdout ( Stdio :: null ( ) )
201- . status ( )
202- . map_or ( false , |status| status. success ( ) ) ;
198+ let mode = matches. opt_str ( "mode" ) . unwrap ( ) . parse ( ) . expect ( "invalid mode" ) ;
199+ let has_tidy = if mode == Mode :: Rustdoc {
200+ Command :: new ( "tidy" )
201+ . arg ( "--version" )
202+ . stdout ( Stdio :: null ( ) )
203+ . status ( )
204+ . map_or ( false , |status| status. success ( ) )
205+ } else {
206+ // Avoid spawning an external command when we know tidy won't be used.
207+ false
208+ } ;
203209 Config {
204210 bless : matches. opt_present ( "bless" ) ,
205211 compile_lib_path : make_absolute ( opt_path ( matches, "compile-lib-path" ) ) ,
@@ -218,7 +224,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
218224 src_base,
219225 build_base : opt_path ( matches, "build-base" ) ,
220226 stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
221- mode : matches . opt_str ( "mode" ) . unwrap ( ) . parse ( ) . expect ( "invalid mode" ) ,
227+ mode,
222228 suite : matches. opt_str ( "suite" ) . unwrap ( ) ,
223229 debugger : None ,
224230 run_ignored,
You can’t perform that action at this time.
0 commit comments