2025-05-29 20:40:50 +00:00
|
|
|
#![feature(doc_cfg)]
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
|
|
|
// regression test for https://github.com/rust-lang/rust/issues/138112
|
|
|
|
|
2025-05-30 13:34:04 +00:00
|
|
|
//@ 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'
|
2025-05-29 20:40:50 +00:00
|
|
|
#[doc(cfg(false))]
|
|
|
|
pub fn foo() {}
|
|
|
|
|
2025-05-30 13:34:04 +00:00
|
|
|
// a cfg(true) will simply be omitted, as it is the same as no cfg.
|
|
|
|
//@ count 'foo/fn.bar.html' '//*[@class="stab portability"]' 0
|
2025-05-29 20:40:50 +00:00
|
|
|
#[doc(cfg(true))]
|
|
|
|
pub fn bar() {}
|