rustdoc: Stop using HirIds

Use `LocalDefId`s instead
This commit is contained in:
Vadim Petrochenkov
2023-01-26 14:30:28 +04:00
parent e187f8871e
commit 347fa7a26f
10 changed files with 113 additions and 151 deletions

View File

@@ -216,13 +216,7 @@ impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
);
let has_doc_example = tests.found_tests != 0;
// The `expect_def_id()` should be okay because `local_def_id_to_hir_id`
// would presumably panic if a fake `DefIndex` were passed.
let hir_id = self
.ctx
.tcx
.hir()
.local_def_id_to_hir_id(i.item_id.expect_def_id().expect_local());
let hir_id = DocContext::as_local_hir_id(self.ctx.tcx, i.item_id).unwrap();
let (level, source) = self.ctx.tcx.lint_level_at_node(MISSING_DOCS, hir_id);
// In case we have: