Skip to content

Commit 169a1ca

Browse files
Don't pass doctest feature by default
1 parent 59a31c8 commit 169a1ca

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/librustdoc/config.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,7 @@ impl Options {
343343
let output = matches.opt_str("o")
344344
.map(|s| PathBuf::from(&s))
345345
.unwrap_or_else(|| PathBuf::from("doc"));
346-
let mut cfgs = matches.opt_strs("cfg");
347-
if should_test {
348-
cfgs.push("doctest".to_string());
349-
}
346+
let cfgs = matches.opt_strs("cfg");
350347

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

src/librustdoc/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub fn run(options: Options) -> i32 {
6464

6565
let mut cfgs = options.cfgs.clone();
6666
cfgs.push("rustdoc".to_owned());
67+
cfgs.push("doctest".to_owned());
6768
let config = interface::Config {
6869
opts: sessopts,
6970
crate_cfg: config::parse_cfgspecs(cfgs),

src/test/rustdoc-ui/cfg-test.stdout

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

2-
running 2 tests
3-
test $DIR/cfg-test.rs - Bar (line 28) ... ok
2+
running 1 test
43
test $DIR/cfg-test.rs - Foo (line 20) ... ok
54

6-
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
76

0 commit comments

Comments
 (0)