-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Long lists of doc_cfg targets are not sorted in a useful way #156391
Copy link
Copy link
Open
Labels
A-cfgArea: `cfg` conditional compilationArea: `cfg` conditional compilationC-bugCategory: This is a bug.Category: This is a bug.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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-cfgArea: `cfg` conditional compilationArea: `cfg` conditional compilationC-bugCategory: This is a bug.Category: This is a bug.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.
The "Available on ..." badges about target-exclusive documentation items generated by the
doc_cfgfeature are not sorted and appear to reuse the order of predicates as they appear in the source code. This is problematic because:cfgblock in the source made.Code
The
cfgis taken fromUnixStream::peer_cred.Reproduction Steps
cargo +nightly docwith the above code.Expected Outcome
The lists are sorted in a deterministic and useful manner, e.g. in descending order of popularity/tier status and alphabetically.
An example ordered by tier status and alphabetically would be:
Actual Output
Screenshots of the rendered docs listed under Code:
Note where the major targets Linux and Apple that many people will be looking for appear in the list.
Version
rustdoc 1.97.0-nightly (82bee9650 2026-05-09)