From 24d806ccfa0842f5b65f90a9145fd2439d5c4d34 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 7 Feb 2024 20:14:35 +0000 Subject: Stop using is_copy_modulo_regions when building clone shim --- compiler/rustc_ty_utils/src/instance.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/rustc_ty_utils/src/instance.rs') diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 9faad10dd14..f47791991a9 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -209,10 +209,8 @@ fn resolve_associated_item<'tcx>( let name = tcx.item_name(trait_item_id); if name == sym::clone { let self_ty = trait_ref.self_ty(); - - let is_copy = self_ty.is_copy_modulo_regions(tcx, param_env); match self_ty.kind() { - _ if is_copy => (), + ty::FnDef(..) | ty::FnPtr(_) => (), ty::Coroutine(..) | ty::CoroutineWitness(..) | ty::Closure(..) -- cgit 1.4.1-3-g733a5