Skip to content

Commit 1a30042

Browse files
Remove unnecessary opt_local_def_id_to_hir_id
1 parent d8c99f3 commit 1a30042

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/librustc_privacy/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -943,11 +943,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
943943
let macro_module_def_id =
944944
ty::DefIdTree::parent(self.tcx, self.tcx.hir().local_def_id(md.hir_id).to_def_id())
945945
.unwrap();
946-
// FIXME(#71104) Should really be using just `as_local_hir_id` but
947-
// some `DefId` do not seem to have a corresponding HirId.
948-
let hir_id = macro_module_def_id
949-
.as_local()
950-
.and_then(|def_id| self.tcx.hir().opt_local_def_id_to_hir_id(def_id));
946+
let hir_id =
947+
macro_module_def_id.as_local().map(|def_id| self.tcx.hir().as_local_hir_id(def_id));
951948
let mut module_id = match hir_id {
952949
Some(module_id) if self.tcx.hir().is_hir_id_module(module_id) => module_id,
953950
// `module_id` doesn't correspond to a `mod`, return early (#63164, #65252).

0 commit comments

Comments
 (0)