Open Aaron1011 opened 3 years ago
@rustbot claim
Should the struct just be printed in one line like the integers currently? That seems like the simplest solution and closest to the number constants but may be really messy for larger structs.
Does rustdoc have its own printing code for constants or is it using the MIR pretty-printer?
is this feature still being worked on? can we first make the simple cases work, where the type of the constant is a transparent wrapper of primitive types, this pattern is used by many bitflag types and ffi binding types.
When rustdoc renders a
const
item, it will print the actual (evaluated) value for primitives. For example, https://doc.rust-lang.org/std/i32/constant.MAX.html:It would be useful to do the same for ADT values (structs, enums, and unions). For example:
would print something like:
on the page for
FOO
.