Description
From #43781 (comment) and #43781 (comment).
Currently #[cfg(any(feature = "danger", test))]
shows up as:
This seems to be undesired behavior. I'm not familiar with the Rust compiler, but looking through the code lead me to the conclusion that the best way to do this is transform Attribute
s, removing undesired cfg
s before passing them to further processing.
The current implementation of doc_hide_cfg
can only remove cfg
s that have an exact match. #![doc(cfg_hide(feature = "x"))]
can only hide #[cfg(feature = "x")]
, it can't hide #[cfg(any(feature = "x", feature = "y"))]
or #[cfg(all(feature = "x", feature = "y"))]
. So my impression is that we can't hook into doc_hide_cfg
to solve this.
Implementing what I described above could also pave the way to adjust the behaviour of cfg_hide
and allow it to match for cfg
s inside any
and all
, if this is desired.
Cc #43781.