rust-lang / rust

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

rustdoc: Appearance of `#[doc(hidden)]` differs from all the other attributes #132304

Open fmease opened 1 week ago

fmease commented 1 week ago

One reproducer where it's quite pronounced:

#[doc(hidden)]
#[non_exhaustive]
#[repr(C)]
pub struct S(u8);

Output (with --document-hidden-items -Zunstable-options[^1]):

Image

That's because it gets rendered separately in visibility_print_with_space. I would rather we didn't do that. It should be printed together with all the other attributes and have the same visual appearance.

[^1]: Hence the https://github.com/rust-lang/rust/labels/requires-nightly label

compiler-errors commented 5 days ago

Screenshot is broken :(

fmease commented 5 days ago

Oops, fixed. The link pointed into my private issue tracker. Reuploaded. Thanks for the notice :)