Skip to content

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

@jyn514

Description

@jyn514
Member

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)

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
on Nov 5, 2021
changed the title [-]Rustc doesn't emit `missing_doc` warning for documentation on generic parameters[/-] [+]Rustc doesn't emit `unused_doc_comment` warning for documentation on generic parameters[/+] on Nov 7, 2021
changed the title [-]Rustc doesn't emit `unused_doc_comment` warning for documentation on generic parameters[/-] [+]Rustc doesn't emit `unused_doc_comments` warning for documentation on generic parameters[/+] on Nov 7, 2021
added
E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
on Nov 30, 2021
self-assigned this
on Nov 30, 2021
added a commit that references this issue on Nov 30, 2021
7baafb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Participants

    @jyn514

    Issue actions

      Rustc doesn't emit `unused_doc_comments` warning for documentation on generic parameters · Issue #90610 · rust-lang/rust