@@ -501,10 +501,7 @@ fn add_exe_suffix(input: String, target: &TargetTuple) -> String {
501501 input + & exe_suffix
502502}
503503
504- fn wrapped_rustc_command < ' a > (
505- rustc_wrappers : & ' a [ PathBuf ] ,
506- rustc_binary : & ' a Path ,
507- ) -> ( Command , & ' a Path ) {
504+ fn wrapped_rustc_command < ' a > ( rustc_wrappers : & ' a [ PathBuf ] , rustc_binary : & ' a Path ) -> Command {
508505 let mut args = rustc_wrappers. iter ( ) . map ( PathBuf :: as_path) . chain ( [ rustc_binary] ) ;
509506
510507 let exe = args. next ( ) . expect ( "unable to create rustc command" ) ;
@@ -513,7 +510,7 @@ fn wrapped_rustc_command<'a>(
513510 command. arg ( arg) ;
514511 }
515512
516- ( command, rustc_wrappers . first ( ) . map ( |p| & * * p ) . unwrap_or ( rustc_binary ) )
513+ command
517514}
518515
519516/// Information needed for running a bundle of doctests.
@@ -633,8 +630,7 @@ fn run_test(
633630 . test_builder
634631 . as_deref ( )
635632 . unwrap_or_else ( || rustc_interface:: util:: rustc_path ( sysroot) . expect ( "found rustc" ) ) ;
636- let ( mut compiler, binary_path) =
637- wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
633+ let mut compiler = wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
638634
639635 compiler. args ( & compiler_args) ;
640636
@@ -675,6 +671,7 @@ fn run_test(
675671
676672 debug ! ( "compiler invocation for doctest: {compiler:?}" ) ;
677673
674+ let binary_path = compiler. get_program ( ) . to_os_string ( ) ;
678675 let mut child = match compiler. spawn ( ) {
679676 Ok ( child) => child,
680677 Err ( error) => {
@@ -690,7 +687,7 @@ fn run_test(
690687 // build it now
691688 let runner_input_file = doctest. path_for_merged_doctest_runner ( ) ;
692689
693- let ( mut runner_compiler, binary_path ) =
690+ let mut runner_compiler =
694691 wrapped_rustc_command ( & rustdoc_options. test_builder_wrappers , rustc_binary) ;
695692 // the test runner does not contain any user-written code, so this doesn't allow
696693 // the user to exploit nightly-only features on stable
@@ -743,6 +740,7 @@ fn run_test(
743740 let status = if !status. success ( ) {
744741 status
745742 } else {
743+ let binary_path = runner_compiler. get_program ( ) . to_os_string ( ) ;
746744 let mut child_runner = match runner_compiler. spawn ( ) {
747745 Ok ( child) => child,
748746 Err ( error) => {
0 commit comments