1
Fork 0

short-circuit the easy cases in is_copy_modulo_regions

This change is somewhat extensive, since it affects MIR -- since this is called to determine Copy vs Move -- so any test that's `no_core` needs to actually have the normal `impl`s it uses.
This commit is contained in:
Scott McMurray 2022-03-05 23:51:10 -08:00
parent b5a54d8777
commit 54408f0963
11 changed files with 18 additions and 2 deletions

View file

@ -704,7 +704,7 @@ impl<'tcx> Ty<'tcx> {
tcx_at: TyCtxtAt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
) -> bool {
tcx_at.is_copy_raw(param_env.and(self))
self.is_trivially_pure_clone_copy() || tcx_at.is_copy_raw(param_env.and(self))
}
/// Checks whether values of this type `T` have a size known at