-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Remove cfg(test) from doc_auto_cfg #91740
Copy link
Copy link
Closed
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)F-doc_auto_cfg`#![feature(doc_auto_cfg)]``#![feature(doc_auto_cfg)]`F-doc_cfg`#![feature(doc_cfg)]``#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)F-doc_auto_cfg`#![feature(doc_auto_cfg)]``#![feature(doc_auto_cfg)]`F-doc_cfg`#![feature(doc_cfg)]``#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
Attributes, removing undesiredcfgs before passing them to further processing.The current implementation of
doc_hide_cfgcan only removecfgs 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 intodoc_hide_cfgto solve this.Implementing what I described above could also pave the way to adjust the behaviour of
cfg_hideand allow it to match forcfgs insideanyandall, if this is desired.Cc #43781.