hir().local_def_id_to_hir_id()
tcx.local_def_id_to_hir_id()
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.