View all comments
Actual Output
In the generated documentation for the core library, it reports LowerExp to 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
LowerExp is 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:
|
// Include wasm32 in here since it doesn't reflect the native pointer size, and |
|
// often cares strongly about getting a smaller code size. |
|
#[cfg(any(target_pointer_width = "64", target_arch = "wasm32"))] |
|
mod imp { |
|
use super::*; |
|
impl_Display!(i8, u8, i16, u16, i32, u32, i64, u64, isize, usize; as u64 into display_u64); |
|
impl_Exp!(i8, u8, i16, u16, i32, u32, i64, u64, isize, usize; as u64 into exp_u64); |
|
} |
|
|
|
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32")))] |
|
mod imp { |
|
use super::*; |
|
impl_Display!(i8, u8, i16, u16, i32, u32, isize, usize; as u32 into display_u32); |
|
impl_Display!(i64, u64; as u64 into display_u64); |
|
|
|
impl_Exp!(i8, u8, i16, u16, i32, u32, isize, usize; as u32 into exp_u32); |
|
impl_Exp!(i64, u64; as u64 into exp_u64); |
|
} |
|
impl_Exp!(i128, u128; as u128 into exp_u128); |
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:
|
#![doc(auto_cfg(hide( |
|
no_fp_fmt_parse, |
|
target_pointer_width = "16", |
|
target_pointer_width = "32", |
|
target_pointer_width = "64", |
|
target_has_atomic = "8", |
|
target_has_atomic = "16", |
|
target_has_atomic = "32", |
|
target_has_atomic = "64", |
|
target_has_atomic = "ptr", |
|
target_has_atomic_equal_alignment = "8", |
|
target_has_atomic_equal_alignment = "16", |
|
target_has_atomic_equal_alignment = "32", |
|
target_has_atomic_equal_alignment = "64", |
|
target_has_atomic_equal_alignment = "ptr", |
|
target_has_atomic_load_store = "8", |
|
target_has_atomic_load_store = "16", |
|
target_has_atomic_load_store = "32", |
|
target_has_atomic_load_store = "64", |
|
target_has_atomic_load_store = "ptr", |
|
)))] |
If I remove the target_pointer_widths from the doc(auto_cfg(hide(..., then it gets shown like this (which is not really better tbh):

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):