Skip to content

Commit f5da7c4

Browse files
committed
Fix compiler
1 parent d1d899b commit f5da7c4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
721721
hir::CoroutineSource::Closure => " of async gen closure",
722722
hir::CoroutineSource::Fn => {
723723
let parent_item =
724-
hir.get_by_def_id(hir.get_parent_item(mir_hir_id).def_id);
724+
tcx.hir_node_by_def_id(hir.get_parent_item(mir_hir_id).def_id);
725725
let output = &parent_item
726726
.fn_decl()
727727
.expect("coroutine lowered from async gen fn should be in fn")

compiler/rustc_hir_typeck/src/coercion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16941694
let ret_msg = "return a value for the case when the loop has zero elements to iterate on";
16951695
let ret_ty_msg =
16961696
"otherwise consider changing the return type to account for that possibility";
1697-
if let Some(node) = hir.find(item.into())
1697+
if let Some(node) = tcx.opt_hir_node(item.into())
16981698
&& let Some(body_id) = node.body_id()
16991699
&& let Some(sig) = node.fn_sig()
17001700
&& let hir::ExprKind::Block(block, _) = hir.body(body_id).value.kind

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
10281028
}
10291029
}
10301030
let hir_id = self.tcx.local_def_id_to_hir_id(obligation.cause.body_id);
1031-
let body_id = match self.tcx.hir().find(hir_id) {
1031+
let body_id = match self.tcx.opt_hir_node(hir_id) {
10321032
Some(hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(_, _, body_id), .. })) => {
10331033
body_id
10341034
}
@@ -1154,7 +1154,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
11541154

11551155
if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = expr.kind
11561156
&& let hir::Path { res: hir::def::Res::Local(hir_id), .. } = path
1157-
&& let Some(hir::Node::Pat(binding)) = self.tcx.hir().find(*hir_id)
1157+
&& let Some(hir::Node::Pat(binding)) = self.tcx.opt_hir_node(*hir_id)
11581158
&& let Some(parent) = self.tcx.hir().find_parent(binding.hir_id)
11591159
{
11601160
// We've reached the root of the method call chain...

0 commit comments

Comments
 (0)