#rustdoc documents massive constant

13 messages · Page 1 of 1 (latest)

thin sparrow
#

rustdoc has gone back and forth on whether to show constant values for various reasons:
https://github.com/rust-lang/rust/pull/53409
https://github.com/rust-lang/rust/pull/66221

GitHub

Part of #44348.
Before:

After:

cc @nox
r? @QuietMisdreavus

GitHub

Fixes #66099, making rustdoc show evaluated constant scalar values.

where main.rs is
pub const VAL3: i32 = i32::max_value();
pub const VAL4: i32 = i32::max_value() - 1;

As a fallback, when a cons...

#

this suggests to me that "let the crate author control it" might be welcomed as letting these different situations be handled differently

#

(I don't see an existing issue for that)

remote island
#

this appears to be the relevant issue

#

it's closed because a hack was PRed

#

How do I get rustdoc to... not?

#

the constant is generated using a macro

silver lichen
#

lmao

#

you might want to use it through another constant?

#

i.e. set the value of EDGES to a private constant REAL_EDGES

remote island
#

would be nice if there was a rustdoc option for that