about summary refs log tree commit diff
path: root/tests/rustdoc/cfg-bool.rs
blob: 0aaa132e0b54032e50a3bf9b57f4055f9b5430fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(doc_cfg)]
#![crate_name = "foo"]

// regression test for https://github.com/rust-lang/rust/issues/138112

//@ has 'foo/index.html'
//@ has - '//*[@class="stab portability"]/@title' 'Available nowhere'

//@ count 'foo/fn.foo.html' '//*[@class="stab portability"]' 1
//@ has 'foo/fn.foo.html' '//*[@class="stab portability"]' 'Available nowhere'
#[doc(cfg(false))]
pub fn foo() {}

// a cfg(true) will simply be omitted, as it is the same as no cfg.
//@ count 'foo/fn.bar.html' '//*[@class="stab portability"]' 0
#[doc(cfg(true))]
pub fn bar() {}