From c6454dd582c66a53bbf91947098af59689f61c1e Mon Sep 17 00:00:00 2001 From: Maybe Lapkin Date: Fri, 29 Nov 2024 20:27:24 +0100 Subject: [PATCH] don't polymorphize without a reason to --- compiler/rustc_mir_build/src/check_tail_calls.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_mir_build/src/check_tail_calls.rs b/compiler/rustc_mir_build/src/check_tail_calls.rs index e6a25634e29..6eade204970 100644 --- a/compiler/rustc_mir_build/src/check_tail_calls.rs +++ b/compiler/rustc_mir_build/src/check_tail_calls.rs @@ -153,8 +153,7 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> { fn needs_location(&self, ty: Ty<'tcx>) -> bool { if let &ty::FnDef(did, substs) = ty.kind() { let instance = - ty::Instance::expect_resolve(self.tcx, self.typing_env, did, substs, DUMMY_SP) - .polymorphize(self.tcx); + ty::Instance::expect_resolve(self.tcx, self.typing_env, did, substs, DUMMY_SP); instance.def.requires_caller_location(self.tcx) } else {