rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.98k stars 12.68k forks source link

rustdoc: the required const feature gate is not shown #131618

Open RalfJung opened 1 week ago

RalfJung commented 1 week ago

For regular unstable functions, rustdoc shows something like this

Image

However, for const-unstable functions, all we get is

Image

There's no indication of what the feature gate is. Worse, if the function is unstable and const-unstable, but under different feature gates, then there's not even the "const: unstable" that links to the issue -- there's no way to figure out what the const feature gate is other than looking at the source.

Cc @rust-lang/rustdoc

RalfJung commented 1 week ago

Turns out the "const: unstable" has a tooltip indicating the const feature gate. But that can't be used for copy-paste, and it is quite hard to notice.