Skip to content

Commit dcff6f7

Browse files
committedNov 25, 2023
rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup
1 parent f5dc265 commit dcff6f7

File tree

110 files changed

+189
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+189
-199
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
413413
(None, &[][..], 0)
414414
};
415415
if let Some(def_id) = def_id
416-
&& let Some(node) = hir.find(hir.local_def_id_to_hir_id(def_id))
416+
&& let Some(node) = hir.find(self.infcx.tcx.local_def_id_to_hir_id(def_id))
417417
&& let Some(fn_sig) = node.fn_sig()
418418
&& let Some(ident) = node.ident()
419419
&& let Some(pos) = args.iter().position(|arg| arg.hir_id == expr.hir_id)
@@ -3243,7 +3243,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
32433243
) -> Option<AnnotatedBorrowFnSignature<'tcx>> {
32443244
debug!("annotate_fn_sig: did={:?} sig={:?}", did, sig);
32453245
let is_closure = self.infcx.tcx.is_closure(did.to_def_id());
3246-
let fn_hir_id = self.infcx.tcx.hir().local_def_id_to_hir_id(did);
3246+
let fn_hir_id = self.infcx.tcx.local_def_id_to_hir_id(did);
32473247
let fn_decl = self.infcx.tcx.hir().fn_decl_by_hir_id(fn_hir_id)?;
32483248

32493249
// We need to work out which arguments to highlight. We do this by looking

‎compiler/rustc_borrowck/src/diagnostics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
958958
"closure_span: def_id={:?} target_place={:?} places={:?}",
959959
def_id, target_place, places
960960
);
961-
let hir_id = self.infcx.tcx.hir().local_def_id_to_hir_id(def_id);
961+
let hir_id = self.infcx.tcx.local_def_id_to_hir_id(def_id);
962962
let expr = &self.infcx.tcx.hir().expect_expr(hir_id).kind;
963963
debug!("closure_span: hir_id={:?} expr={:?}", hir_id, expr);
964964
if let hir::ExprKind::Closure(&hir::Closure { body, fn_decl_span, .. }) = expr {

0 commit comments

Comments
 (0)