@@ -67,9 +67,6 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
67
67
}
68
68
}
69
69
70
- if let Some ( sysroot) = & options. maybe_sysroot {
71
- content. push ( format ! ( "--sysroot={}" , sysroot. display( ) ) ) ;
72
- }
73
70
for lib_str in & options. lib_strs {
74
71
content. push ( format ! ( "-L{lib_str}" ) ) ;
75
72
}
@@ -411,6 +408,10 @@ fn run_test(
411
408
412
409
compiler. arg ( & format ! ( "@{}" , rustdoc_options. arg_file. display( ) ) ) ;
413
410
411
+ if let Some ( sysroot) = & rustdoc_options. maybe_sysroot {
412
+ compiler. arg ( format ! ( "--sysroot={}" , sysroot. display( ) ) ) ;
413
+ }
414
+
414
415
compiler. arg ( "--edition" ) . arg ( & edition. to_string ( ) ) ;
415
416
compiler. env ( "UNSTABLE_RUSTDOC_TEST_PATH" , path) ;
416
417
compiler. env ( "UNSTABLE_RUSTDOC_TEST_LINE" , format ! ( "{}" , line as isize - line_offset as isize ) ) ;
@@ -950,6 +951,7 @@ pub(crate) struct IndividualTestOptions {
950
951
runtool_args : Vec < String > ,
951
952
target : TargetTriple ,
952
953
test_id : String ,
954
+ maybe_sysroot : Option < PathBuf > ,
953
955
}
954
956
955
957
impl IndividualTestOptions {
@@ -982,6 +984,7 @@ impl IndividualTestOptions {
982
984
runtool_args : options. runtool_args . clone ( ) ,
983
985
target : options. target . clone ( ) ,
984
986
test_id,
987
+ maybe_sysroot : options. maybe_sysroot . clone ( ) ,
985
988
}
986
989
}
987
990
}
0 commit comments