rust/tests/rustdoc/cfg-bool.rs
binarycat c6eb1d95d3 rustdoc: display doc(cfg(false)) properly
before we had an extra 'on' that was
ungramatical.

fixes https://github.com/rust-lang/rust/issues/138112
2025-05-29 15:40:50 -05:00

14 lines
401 B
Rust

#![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() {}