Skip to content

Commit 8fc0d47

Browse files
make the missing_docs lint check for doc(include)
1 parent 06fbd59 commit 8fc0d47

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/librustc_lint/builtin.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,27 @@ impl MissingDoc {
349349
}
350350
}
351351

352-
let has_doc = attrs.iter().any(|a| a.is_value_str() && a.check_name("doc"));
352+
fn has_doc(attr: &ast::Attribute) -> bool {
353+
if !attr.check_name("doc") {
354+
return false;
355+
}
356+
357+
if attr.is_value_str() {
358+
return true;
359+
}
360+
361+
if let Some(list) = attr.meta_item_list() {
362+
for meta in list {
363+
if meta.check_name("include") {
364+
return true;
365+
}
366+
}
367+
}
368+
369+
false
370+
}
371+
372+
let has_doc = attrs.iter().any(|a| has_doc(a));
353373
if !has_doc {
354374
cx.span_lint(MISSING_DOCS,
355375
sp,

0 commit comments

Comments
 (0)