Skip to content

Commit

Permalink
Move --sysroot argument out of the argument file to fix miri issue
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 25, 2024
1 parent 42198bf commit ac9b4e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustdoc/doctest.rs
Expand Up @@ -67,9 +67,6 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
}
}

if let Some(sysroot) = &options.maybe_sysroot {
content.push(format!("--sysroot={}", sysroot.display()));
}
for lib_str in &options.lib_strs {
content.push(format!("-L{lib_str}"));
}
Expand Down Expand Up @@ -411,6 +408,10 @@ fn run_test(

compiler.arg(&format!("@{}", rustdoc_options.arg_file.display()));

if let Some(sysroot) = &rustdoc_options.maybe_sysroot {
compiler.arg(format!("--sysroot={}", sysroot.display()));
}

compiler.arg("--edition").arg(&edition.to_string());
compiler.env("UNSTABLE_RUSTDOC_TEST_PATH", path);
compiler.env("UNSTABLE_RUSTDOC_TEST_LINE", format!("{}", line as isize - line_offset as isize));
Expand Down

0 comments on commit ac9b4e6

Please sign in to comment.