Skip to content

Commit

Permalink
Extend unused_doc_comments lint to check on blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 2, 2022
1 parent c42d846 commit ac891ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compiler/rustc_lint/src/builtin.rs
Expand Up @@ -1086,6 +1086,16 @@ impl EarlyLintPass for UnusedDocComment {
fn check_generic_param(&mut self, cx: &EarlyContext<'_>, param: &ast::GenericParam) {
warn_if_doc(cx, param.ident.span, "generic parameters", &param.attrs);
}

fn check_block(&mut self, cx: &EarlyContext<'_>, block: &ast::Block) {
warn_if_doc(cx, block.span, "block", &block.attrs());
}

fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
if let ast::ItemKind::ForeignMod(_) = item.kind {
warn_if_doc(cx, item.span, "extern block", &item.attrs);
}
}
}

declare_lint! {
Expand Down

0 comments on commit ac891ea

Please sign in to comment.