The lint `unused_doc_comments` classifies all kinds of `#[doc …]` attributes as documentation comments
The lint unused_doc_comments triggers on any #[doc …] / #![doc …] (on any token stream inside the attribute) when it should only trigger on actual documentation comments i.e. #[doc = …] / #![doc = …].
E.g. the following code incorrectly labels #[doc(hidden)] as a doc comment:
fn f<#[doc(hidden)] T>() {}
warning: unused doc comment
--> q.rs:1:6
|
1 | fn f<#[doc(hidden)] T>() {}
| ^^^^^^^^^^^^^^ - rustdoc does not generate documentation for generic parameters
|
= note: `#[warn(unused_doc_comments)]` on by default
= help: use `//` for a plain comment
@rustbot label A-lint @rustbot claim
@fmease if you change this, I think you should also make sure that unused_attributes is being run for doc(hidden) attributes and not just built-in attrs.
Revisiting this, I'm inclined to emit unused_attributes for those kinds of doc attrs but I guess it's a bit weird to emit a rustdoc-specific lint in one situation and a rustdoc-agnostic one in another. I really don't want to intro a new rustdoc-specific lint for this. Impl is trivial but those kinds of decisions are always a bit annoying ^^'