1
Fork 0

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.
This commit is contained in:
Matthias Krüger 2025-01-30 12:45:32 +01:00 committed by GitHub
commit aab61ad663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 0 deletions

View file

@ -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),
}
}