diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-30 12:45:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-30 12:45:32 +0100 |
| commit | aab61ad663e3a3b942f99119ba84d38b8122f8f8 (patch) | |
| tree | 5c07729fa8cd2f080792cdaedd0d8e268c9fc1eb /compiler | |
| parent | 78ded09912a6f64ab83978ab70b40ef7ff94b833 (diff) | |
| parent | a639e276f3bfb0e0538bad78f3d68ebb7877aeaa (diff) | |
| download | rust-aab61ad663e3a3b942f99119ba84d38b8122f8f8.tar.gz rust-aab61ad663e3a3b942f99119ba84d38b8122f8f8.zip | |
Rollup merge of #136179 - oli-obk:push-vxvyttorquxw, r=BoxyUwU
Allow transmuting generic pattern types to and from their base Pattern types always have the same size as their base type, so we can just ignore the pattern and look at the base type for figuring out whether transmuting is possible.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 3 |
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), } } |
