Skip to content

Commit 8ed2292

Browse files
Set test flag when rustdoc is running with --test option
1 parent 4eff852 commit 8ed2292

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ impl Options {
351351
.unwrap_or_else(|| PathBuf::from("doc"));
352352
let mut cfgs = matches.opt_strs("cfg");
353353
cfgs.push("rustdoc".to_string());
354+
if should_test {
355+
cfgs.push("test".to_string());
356+
}
354357

355358
let extension_css = matches.opt_str("e").map(|s| PathBuf::from(&s));
356359

0 commit comments

Comments
 (0)