We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cc42ce commit 6c747e0Copy full SHA for 6c747e0
src/test/rustdoc-ui/cfg-test.rs
@@ -2,18 +2,21 @@
2
// compile-flags:--test
3
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
4
5
+// Crates like core have doctests gated on `cfg(not(test))` so we need to make
6
+// sure `cfg(test)` is not active when running `rustdoc --test`.
7
+
8
/// this doctest will be ignored:
9
///
10
/// ```
11
/// assert!(false);
12
-#[cfg(not(test))]
13
+#[cfg(test)]
14
pub struct Foo;
15
16
/// this doctest will be tested:
17
18
19
/// assert!(true);
20
-#[cfg(test)]
21
+#[cfg(not(test))]
22
src/test/rustdoc-ui/cfg-test.stdout
@@ -1,6 +1,6 @@
1
running 1 test
-test $DIR/cfg-test.rs - Foo (line 15) ... ok
+test $DIR/cfg-test.rs - Foo (line 18) ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
0 commit comments