Skip to content

Commit ac891ea

Browse files
Extend unused_doc_comments lint to check on blocks
1 parent c42d846 commit ac891ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/rustc_lint/src/builtin.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,16 @@ impl EarlyLintPass for UnusedDocComment {
10861086
fn check_generic_param(&mut self, cx: &EarlyContext<'_>, param: &ast::GenericParam) {
10871087
warn_if_doc(cx, param.ident.span, "generic parameters", &param.attrs);
10881088
}
1089+
1090+
fn check_block(&mut self, cx: &EarlyContext<'_>, block: &ast::Block) {
1091+
warn_if_doc(cx, block.span, "block", &block.attrs());
1092+
}
1093+
1094+
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
1095+
if let ast::ItemKind::ForeignMod(_) = item.kind {
1096+
warn_if_doc(cx, item.span, "extern block", &item.attrs);
1097+
}
1098+
}
10891099
}
10901100

10911101
declare_lint! {

0 commit comments

Comments
 (0)