Let InstCombine remove Clone shims inside Clone shims
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
This commit is contained in:
parent
92c6c03805
commit
a7d57aa7c8
13 changed files with 31 additions and 45 deletions
|
@ -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,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue