rustdoc: Rename expect_real to expect_def_id, remove Item::is_fake

This commit is contained in:
Justus K
2021-06-26 17:10:52 +02:00
parent 43e1cdbaf9
commit acd4dc2d0c
13 changed files with 103 additions and 105 deletions

View File

@@ -213,13 +213,13 @@ impl<'a, 'b> fold::DocFolder for CoverageCalculator<'a, 'b> {
let filename = i.span(self.ctx.tcx).filename(self.ctx.sess());
let has_doc_example = tests.found_tests != 0;
// The `expect_real()` should be okay because `local_def_id_to_hir_id`
// 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.def_id.expect_real().expect_local());
.local_def_id_to_hir_id(i.def_id.expect_def_id().expect_local());
let (level, source) = self.ctx.tcx.lint_level_at_node(MISSING_DOCS, hir_id);
// `missing_docs` is allow-by-default, so don't treat this as ignoring the item
// unless the user had an explicit `allow`