1
Fork 0

Let InstCombine remove Clone shims inside Clone shims

Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
This commit is contained in:
Ben Kimock 2024-07-24 19:12:50 -04:00
parent 92c6c03805
commit a7d57aa7c8
13 changed files with 31 additions and 45 deletions

View file

@ -1864,9 +1864,9 @@ impl<'tcx> Ty<'tcx> {
// Definitely absolutely not copy.
ty::Ref(_, _, hir::Mutability::Mut) => false,
// Thin pointers & thin shared references are pure-clone-copy, but for
// anything with custom metadata it might be more complicated.
ty::Ref(_, _, hir::Mutability::Not) | ty::RawPtr(..) => false,
// The standard library has a blanket Copy impl for shared references and raw pointers,
// for all unsized types.
ty::Ref(_, _, hir::Mutability::Not) | ty::RawPtr(..) => true,
ty::Coroutine(..) | ty::CoroutineWitness(..) => false,