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