diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc/cfg-bool.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rustdoc/cfg-bool.rs b/tests/rustdoc/cfg-bool.rs new file mode 100644 index 00000000000..34fdfbe930e --- /dev/null +++ b/tests/rustdoc/cfg-bool.rs @@ -0,0 +1,13 @@ +#![feature(doc_cfg)] +#![crate_name = "foo"] + +// regression test for https://github.com/rust-lang/rust/issues/138112 + +//@ has 'foo/fn.foo.html' '//div[@class="stab portability"]' 'Available nowhere' +#[doc(cfg(false))] +pub fn foo() {} + +// a cfg(true) will simply be ommited, as it is the same as no cfg. +//@ !has 'foo/fn.bar.html' '//div[@class="stab portability"]' '' +#[doc(cfg(true))] +pub fn bar() {} |
