Closed
Description
In my source code, I've declared an associated constant as follows:
struct MyStruct(u8);
impl MyStruct {
pub const KIND: MyStruct = MyStruct(0b0100);
}
If I render the rustdocs for MyStruct
, the following is displayed:
KIND: MyStruct = MyStruct(4)
Instead, I would like to see:
KIND: MyStruct = MyStruct(0b0100)
Or, at the very least:
KIND: MyStruct = MyStruct(0b100)
I've declared the KIND
constant as a binary number because it serves as a mask. I want the rustdocs to reflect this. Said another way, the representation used in the source code is meaningful, and the rustdocs should preserve that meaning. Note that this should also apply to other representations including hexadecimal. This format-preserving behavior should also apply to other constants, not just associated constants.