#[cfg_vis]Expand description
cfg visibility on items
Rules
ⓘ
#[cfg_vis($cfg: meta, $vis: vis)]
$default_vis:vis $($item:tt)*will expend to
ⓘ
#[cfg($cfg)]
$vis $($item)*
#[cfg(not($cfg))]
$default_vis $($item)*Example
use cfg_vis::cfg_vis;
// default visibility is `pub`, while the target is linux, the visibility is `pub(super)`.
#[cfg_vis(target_os = "linux", pub(super))]
pub fn foo() {}