diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-07-24 19:12:50 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-07-25 15:14:42 -0400 |
| commit | a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8 (patch) | |
| tree | 2ec95ebff75de2ac0d843ac244c12ab660baa0b2 /compiler/rustc_middle/src/ty/sty.rs | |
| parent | 92c6c03805408a1a261b98013304e9bbf59ee428 (diff) | |
| download | rust-a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8.tar.gz rust-a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8.zip | |
Let InstCombine remove Clone shims inside Clone shims
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
Diffstat (limited to 'compiler/rustc_middle/src/ty/sty.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index d2b444a066b..da98e3b9f46 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -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, |
