about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/cfg-test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc-ui/cfg-test.rs')
-rw-r--r--src/test/rustdoc-ui/cfg-test.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/cfg-test.rs b/src/test/rustdoc-ui/cfg-test.rs
index 4dcf512d286..5360354d77a 100644
--- a/src/test/rustdoc-ui/cfg-test.rs
+++ b/src/test/rustdoc-ui/cfg-test.rs
@@ -5,6 +5,8 @@
 // Crates like core have doctests gated on `cfg(not(test))` so we need to make
 // sure `cfg(test)` is not active when running `rustdoc --test`.
 
+#![feature(cfg_doctest)]
+
 /// this doctest will be ignored:
 ///
 /// ```
@@ -20,3 +22,11 @@ pub struct Foo;
 /// ```
 #[cfg(not(test))]
 pub struct Foo;
+
+/// this doctest will be tested, but will not appear in documentation:
+///
+/// ```
+/// assert!(true)
+/// ```
+#[cfg(doctest)]
+pub struct Bar;