@@ -67,9 +67,6 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
6767 }
6868 }
6969
70- if let Some ( sysroot) = & options. maybe_sysroot {
71- content. push ( format ! ( "--sysroot={}" , sysroot. display( ) ) ) ;
72- }
7370 for lib_str in & options. lib_strs {
7471 content. push ( format ! ( "-L{lib_str}" ) ) ;
7572 }
@@ -411,6 +408,10 @@ fn run_test(
411408
412409 compiler. arg ( & format ! ( "@{}" , rustdoc_options. arg_file. display( ) ) ) ;
413410
411+ if let Some ( sysroot) = & rustdoc_options. maybe_sysroot {
412+ compiler. arg ( format ! ( "--sysroot={}" , sysroot. display( ) ) ) ;
413+ }
414+
414415 compiler. arg ( "--edition" ) . arg ( & edition. to_string ( ) ) ;
415416 compiler. env ( "UNSTABLE_RUSTDOC_TEST_PATH" , path) ;
416417 compiler. env ( "UNSTABLE_RUSTDOC_TEST_LINE" , format ! ( "{}" , line as isize - line_offset as isize ) ) ;
@@ -950,6 +951,7 @@ pub(crate) struct IndividualTestOptions {
950951 runtool_args : Vec < String > ,
951952 target : TargetTriple ,
952953 test_id : String ,
954+ maybe_sysroot : Option < PathBuf > ,
953955}
954956
955957impl IndividualTestOptions {
@@ -982,6 +984,7 @@ impl IndividualTestOptions {
982984 runtool_args : options. runtool_args . clone ( ) ,
983985 target : options. target . clone ( ) ,
984986 test_id,
987+ maybe_sysroot : options. maybe_sysroot . clone ( ) ,
985988 }
986989 }
987990}
0 commit comments