-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustdoc reports wrong config conditions for impl LowerExp for integers #153655
Copy link
Copy link
Closed
Copy link
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
View all comments
Actual Output
In the generated documentation for the core library, it reports
LowerExpto be only implemented for integers on WebAssembly. See: https://doc.rust-lang.org/1.94.0/core/fmt/trait.LowerExp.html#impl-LowerExp-for-i8.This probably affects other trait implementations as well.
Expected Outcome
LowerExpis available for all integer types on all platforms, therefore I expect it to report nothing regarding configs.Version
1.94.0
Additional Details
In my understanding the problem is a combination of:
First, how the implementation is generated:
rust/library/core/src/fmt/num.rs
Lines 594 to 612 in 3bc6ea5
In the end the trait is implemented for all pointer sizes, but it is different depending on the pointer size.
And second that the pointer size configs are hidden:
rust/library/core/src/lib.rs
Lines 54 to 74 in 3bc6ea5
If I remove the
target_pointer_widths from thedoc(auto_cfg(hide(..., then it gets shown like this (which is not really better tbh):