about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-01-28 11:08:22 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-01-29 10:25:55 +0000
commita639e276f3bfb0e0538bad78f3d68ebb7877aeaa (patch)
treec54690078c312db6ee134ca0fb7e63bd9f2375e1 /compiler/rustc_middle/src
parent22f074129a27e229b30c69b8e8d600dee3593537 (diff)
downloadrust-a639e276f3bfb0e0538bad78f3d68ebb7877aeaa.tar.gz
rust-a639e276f3bfb0e0538bad78f3d68ebb7877aeaa.zip
Allow transmuting generic pattern types to and from their base
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/layout.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
index 0d41a1d7dbf..b212992bd2d 100644
--- a/compiler/rustc_middle/src/ty/layout.rs
+++ b/compiler/rustc_middle/src/ty/layout.rs
@@ -504,6 +504,9 @@ impl<'tcx> SizeSkeleton<'tcx> {
                 }
             }
 
+            // Pattern types are always the same size as their base.
+            ty::Pat(base, _) => SizeSkeleton::compute(base, tcx, typing_env),
+
             _ => Err(err),
         }
     }