We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
RUSTFLAGS
1 parent 6a2cd0d commit 782d228Copy full SHA for 782d228
src/librustdoc/doctest.rs
@@ -407,6 +407,14 @@ 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 rustflags.split(' ').map(|flag| flag.trim()).filter(|flag| !flag.is_empty()) {
415
+ compiler.arg(flag);
416
+ }
417
418
419
if scraped_test.no_run(rustdoc_options)
420
&& !langstr.compile_fail
0 commit comments