-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustdoc does not show documentation on empty impl blocks #90866
Comments
I'll write the fix in the next days. |
A suggestion: Since this is such an unusual case, add a special note like
after the displayed documentation. This will help people parse the structure of the documentation page, understand what it means that the thing is said to be an implementation, and understand that it's not purely a rustdoc bug/infelicity that it's showing an empty section. |
Good idea! |
…=jsha Add empty impl blocks if they have documentation Fixes rust-lang#90866. The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with rust-lang#89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc `@Mark-Simulacrum).` It looks like this: ![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png) cc `@jyn514` r? `@camelid`
…=jsha Add empty impl blocks if they have documentation Fixes rust-lang#90866. The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with rust-lang#89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ``@Mark-Simulacrum).`` It looks like this: ![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png) cc ``@jyn514`` r? ``@camelid``
I tried this code:
I expected to see this happen: Either the comment should show up in the generated docs, or rustdoc/rustc should issue a warning.
Instead, this happened: The documentation is silently ignored.
I think we should show the documentation, since people like to use impl blocks for grouping and it's possible that all the items in the impl have a
#[cfg()]
macro that's false.Thanks @WaffleLapkin for the bug report and @GuillaumeGomez for giving feedback on the proper fix.
Meta
rustdoc --version --verbose
: rustdoc 1.58.0-nightly (e90c5fb 2021-11-12)The text was updated successfully, but these errors were encountered: