1
Fork 0

don't polymorphize without a reason to

This commit is contained in:
Maybe Lapkin 2024-11-29 20:27:24 +01:00
parent ef5808a035
commit c6454dd582
No known key found for this signature in database

View file

@ -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 {