We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
RUSTFLAGS
1 parent 6a2cd0d commit d690743Copy full SHA for d690743
src/librustdoc/doctest.rs
@@ -407,6 +407,16 @@ fn run_test(
407
compiler.arg("-W").arg("unused_crate_dependencies");
408
compiler.arg("-Z").arg("unstable-options");
409
}
410
+ // If arguments are passed to `RUSTFLAGS` environment variable, let's add them when compiling
411
+ // the doctest.
412
+ if let Ok(rustflags) = std::env::var("RUSTFLAGS") {
413
+ // Very simple parsing implementation. Might be a good idea to correctly handle strings.
414
+ for flag in
415
+ rustflags.split_whitespace().map(|flag| flag.trim()).filter(|flag| !flag.is_empty())
416
+ {
417
+ compiler.arg(flag);
418
+ }
419
420
421
if scraped_test.no_run(rustdoc_options)
422
&& !langstr.compile_fail
0 commit comments