Code
This will include the cfgs in the docs:
#![feature(doc_cfg)]
#![doc(auto_cfg)]
#[cfg(target_os = "linux")]
pub type One = u32;
#[doc(cfg(target_os = "linux"))]
pub type Two = u32;
But this will not:
#![feature(doc_cfg)]
#![doc(auto_cfg)]
mod inner {
#[cfg(target_os = "linux")]
pub type One = u32;
#[doc(cfg(target_os = "linux"))]
pub type Two = u32;
}
pub use self::inner::{One, Two};
Both
Version
rustdoc 1.96.0-nightly (55e86c996 2026-04-02)
Code
This will include the
cfgs in the docs:But this will not:
Both
Version
rustdoc 1.96.0-nightly (55e86c996 2026-04-02)