rust/tests/rustdoc-ui/doc-test-rustdoc-feature.rs

16 lines
367 B
Rust
Raw Normal View History

// check-pass
// compile-flags:--test
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
#![feature(doc_cfg)]
2019-11-06 11:32:51 -06:00
// Make sure `cfg(doc)` is set when finding doctests but not inside the doctests.
/// ```
/// #![feature(doc_cfg)]
2019-11-06 11:32:51 -06:00
/// assert!(!cfg!(doc));
/// ```
2019-11-06 11:32:51 -06:00
#[cfg(doc)]
pub struct Foo;