Skip to content

Rustc doesn't emit unused_doc_comments warning for documentation on generic parameters #90610

Closed
@jyn514

Description

@jyn514

I tried this code:

pub fn foo<#[doc = "bar"] A>(_baz: A) {}

I expected to see this happen: Either rustdoc adds "bar" somewhere in the documentation, or rustc gives a warning that the doc-comment does nothing.

Instead, this happened: The doc-comment is silently discarded.

Meta

rustc --version --verbose: rustc 1.58.0-nightly (4961b10 2021-11-04)

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.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