From 70ed6c35211dd1d39391403394322097346d0136 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Fri, 2 Oct 2026 12:01:08 +0200 Subject: [PATCH] Get `inputs_hir` directly from `decl` --- compiler/rustc_hir_typeck/src/check.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/check.rs b/compiler/rustc_hir_typeck/src/check.rs index 4f6345e04070b..6fb75d0e182a4 100644 --- a/compiler/rustc_hir_typeck/src/check.rs +++ b/compiler/rustc_hir_typeck/src/check.rs @@ -63,7 +63,6 @@ pub(super) fn check_fn<'a, 'tcx>( }); // Add formal parameters. - let inputs_hir = tcx.hir_fn_decl_by_hir_id(fn_id).map(|decl| &decl.inputs); let inputs_fn = fn_sig.inputs().iter().copied(); for (idx, (param_ty, param)) in inputs_fn.chain(maybe_va_list).zip(body.params).enumerate() { // We checked the root's signature during wfcheck, but not the child. @@ -79,7 +78,7 @@ pub(super) fn check_fn<'a, 'tcx>( } // Check the pattern. - let ty: Option<&hir::Ty<'_>> = inputs_hir.and_then(|h| h.get(idx)); + let ty: Option<&hir::Ty<'_>> = decl.inputs.get(idx); let ty_span = ty.map(|ty| ty.span); fcx.check_pat_top(param.pat, param_ty, ty_span, None, None); if param.pat.is_never_pattern() {