Rename def_id into item_id when the type is ItemId for readability
This commit is contained in:
@@ -185,7 +185,7 @@ impl<'a, 'b> CoverageCalculator<'a, 'b> {
|
||||
|
||||
impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
|
||||
fn visit_item(&mut self, i: &clean::Item) {
|
||||
if !i.def_id.is_local() {
|
||||
if !i.item_id.is_local() {
|
||||
// non-local items are skipped because they can be out of the users control,
|
||||
// especially in the case of trait impls, which rustdoc eagerly inlines
|
||||
return;
|
||||
@@ -223,7 +223,7 @@ impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
|
||||
.ctx
|
||||
.tcx
|
||||
.hir()
|
||||
.local_def_id_to_hir_id(i.def_id.expect_def_id().expect_local());
|
||||
.local_def_id_to_hir_id(i.item_id.expect_def_id().expect_local());
|
||||
let (level, source) = self.ctx.tcx.lint_level_at_node(MISSING_DOCS, hir_id);
|
||||
|
||||
// In case we have:
|
||||
@@ -237,7 +237,7 @@ impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
|
||||
// there is no need to require documentation on the fields of tuple variants and
|
||||
// tuple structs.
|
||||
let should_be_ignored = i
|
||||
.def_id
|
||||
.item_id
|
||||
.as_def_id()
|
||||
.and_then(|def_id| self.ctx.tcx.parent(def_id))
|
||||
.and_then(|def_id| self.ctx.tcx.hir().get_if_local(def_id))
|
||||
|
||||
Reference in New Issue
Block a user