Rename def_id into item_id when the type is ItemId for readability

This commit is contained in:
Guillaume Gomez
2022-04-16 14:28:09 +02:00
parent f9d4d12b6a
commit b1e6211c5c
23 changed files with 121 additions and 120 deletions

View File

@@ -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))