@@ -500,10 +500,7 @@ fn add_exe_suffix(input: String, target: &TargetTuple) -> String {
500500 input + & exe_suffix
501501}
502502
503- fn wrapped_rustc_command < ' a > (
504- rustc_wrappers : & ' a [ PathBuf ] ,
505- rustc_binary : & ' a Path ,
506- ) -> ( Command , & ' a Path ) {
503+ fn wrapped_rustc_command ( rustc_wrappers : & [ PathBuf ] , rustc_binary : & Path ) -> Command {
507504 let mut args = rustc_wrappers. iter ( ) . map ( PathBuf :: as_path) . chain ( [ rustc_binary] ) ;
508505
509506 let exe = args. next ( ) . expect ( "unable to create rustc command" ) ;
@@ -512,7 +509,7 @@ fn wrapped_rustc_command<'a>(
512509 command. arg ( arg) ;
513510 }
514511
515- ( command, rustc_wrappers . first ( ) . map ( |p| & * * p ) . unwrap_or ( rustc_binary ) )
512+ command
516513}
517514
518515/// Information needed for running a bundle of doctests.
@@ -632,8 +629,7 @@ fn run_test(
632629 . test_builder
633630 . as_deref ( )
634631 . unwrap_or_else ( || rustc_interface:: util:: rustc_path ( sysroot) . expect ( "found rustc" ) ) ;
635- let ( mut compiler, binary_path) =
636- wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
632+ let mut compiler = wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
637633
638634 compiler. args ( & compiler_args) ;
639635
@@ -677,7 +673,7 @@ fn run_test(
677673 let mut child = match compiler. spawn ( ) {
678674 Ok ( child) => child,
679675 Err ( error) => {
680- eprintln ! ( "Failed to spawn {binary_path :?}: {error:?}" ) ;
676+ eprintln ! ( "Failed to spawn {:?}: {error:?}" , compiler . get_program ( ) ) ;
681677 return ( Duration :: default ( ) , Err ( TestFailure :: CompileError ) ) ;
682678 }
683679 } ;
@@ -689,7 +685,7 @@ fn run_test(
689685 // build it now
690686 let runner_input_file = doctest. path_for_merged_doctest_runner ( ) ;
691687
692- let ( mut runner_compiler, binary_path ) =
688+ let mut runner_compiler =
693689 wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
694690 // the test runner does not contain any user-written code, so this doesn't allow
695691 // the user to exploit nightly-only features on stable
@@ -745,7 +741,7 @@ fn run_test(
745741 let mut child_runner = match runner_compiler. spawn ( ) {
746742 Ok ( child) => child,
747743 Err ( error) => {
748- eprintln ! ( "Failed to spawn {binary_path :?}: {error:?}" ) ;
744+ eprintln ! ( "Failed to spawn {:?}: {error:?}" , runner_compiler . get_program ( ) ) ;
749745 return ( Duration :: default ( ) , Err ( TestFailure :: CompileError ) ) ;
750746 }
751747 } ;
0 commit comments