Apply same treatment to MISSING_DOC_CODE_EXAMPLES
This commit is contained in:
@@ -254,12 +254,13 @@ impl<'a, 'b> fold::DocFolder for CoverageCalculator<'a, 'b> {
|
||||
let has_doc_example = tests.found_tests != 0;
|
||||
let hir_id = self.ctx.tcx.hir().local_def_id_to_hir_id(i.def_id.expect_local());
|
||||
let (level, source) = self.ctx.tcx.lint_level_at_node(MISSING_DOCS, hir_id);
|
||||
let should_have_docs = level != lint::Level::Allow || !matches!(source, LintSource::Node(..));
|
||||
let should_have_docs =
|
||||
level != lint::Level::Allow || !matches!(source, LintSource::Node(..));
|
||||
debug!("counting {:?} {:?} in {}", i.type_(), i.name, i.source.filename);
|
||||
self.items.entry(i.source.filename.clone()).or_default().count_item(
|
||||
has_docs,
|
||||
has_doc_example,
|
||||
should_have_doc_example(&i.inner),
|
||||
should_have_doc_example(self.ctx, &i),
|
||||
should_have_docs,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user