Skip to content

Rustdoc does not show documentation on empty impl blocks #90866

Closed
@jyn514

Description

@jyn514

I tried this code:

struct Ty {}
/// Documentation 1
impl Ty {}

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)

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions