rustdoc: forward -Z options to rustc

Currently rustdoc does not forward `-Z` options to rustc when building
test executables. This makes impossible to use rustdoc to run test
samples when crate under test is instrumented with one of sanitizers
`-Zsanitizer=...`, since the final linking step will not include
sanitizer runtime library.

Forward `-Z` options to rustc to solve the issue.

Helps with #43031.
This commit is contained in:
Tomasz Miąsko
2019-10-11 00:00:00 +00:00
parent 000d90b11f
commit 5db17335a1
6 changed files with 39 additions and 15 deletions

View File

@@ -279,6 +279,9 @@ fn run_test(
for codegen_options_str in &options.codegen_options_strs {
compiler.arg("-C").arg(&codegen_options_str);
}
for debugging_option_str in &options.debugging_options_strs {
compiler.arg("-Z").arg(&debugging_option_str);
}
if no_run {
compiler.arg("--emit=metadata");
}